[DOC] Harmonize #=== methods

This commit is contained in:
BurdetteLamar 2026-01-05 18:29:04 +00:00 committed by Peter Zhu
parent a25f468917
commit dd67874ad9
Notes: git 2026-01-05 23:31:07 +00:00
3 changed files with 10 additions and 10 deletions

View File

@ -162,7 +162,7 @@ rb_obj_setup(VALUE obj, VALUE klass, VALUE type)
*
* Returns +true+ or +false+.
*
* Like Object#==, if +object+ is an instance of Object
* Like Object#==, if +other+ is an instance of \Object
* (and not an instance of one of its many subclasses).
*
* This method is commonly overridden by those subclasses,
@ -1892,11 +1892,12 @@ rb_mod_freeze(VALUE mod)
/*
* call-seq:
* mod === obj -> true or false
* self === other -> true or false
*
* Case Equality---Returns <code>true</code> if <i>obj</i> is an
* instance of <i>mod</i> or an instance of one of <i>mod</i>'s descendants.
* Of limited use for modules, but can be used in <code>case</code> statements
* Returns whether +other+ is an instance of +self+,
* or is an instance of a subclass of +self+.
*
* Of limited use for modules, but can be used in +case+ statements
* to classify objects by class.
*/

View File

@ -2054,10 +2054,9 @@ VALUE rb_str_include_range_p(VALUE beg, VALUE end, VALUE val, VALUE exclusive);
/*
* call-seq:
* self === object -> true or false
* self === other -> true or false
*
* Returns +true+ if +object+ is between <tt>self.begin</tt> and <tt>self.end</tt>.
* +false+ otherwise:
* Returns whether +other+ is between <tt>self.begin</tt> and <tt>self.end</tt>:
*
* (1..4) === 2 # => true
* (1..4) === 5 # => false

4
re.c
View File

@ -3728,9 +3728,9 @@ rb_reg_match(VALUE re, VALUE str)
/*
* call-seq:
* regexp === string -> true or false
* self === other -> true or false
*
* Returns +true+ if +self+ finds a match in +string+:
* Returns whether +self+ finds a match in +other+:
*
* /^[a-z]*$/ === 'HELLO' # => false
* /^[A-Z]*$/ === 'HELLO' # => true