U:RDoc::AnyMethod[iI"equal?:ETI"BasicObject#equal?;TF:publico:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [ I"LEquality --- At the Object
level, ==
returns ;TI"Ftrue
only if +obj+ and +other+ are the same object. ;TI"KTypically, this method is overridden in descendant classes to provide ;TI"class-specific meaning.;To:RDoc::Markup::BlankLine o;
; [ I"LUnlike ==
, the equal?
method should never be ;TI"Ioverridden by subclasses as it is used to determine object identity ;TI"M(that is, a.equal?(b)
if and only if a
is the ;TI"$same object as b
):;T@o:RDoc::Markup::Verbatim; [I"obj = "a"
;TI"other = obj.dup
;TI"
;TI" obj == other #=> true
;TI"!obj.equal? other #=> false
;TI" obj.equal? obj #=> true
;T:@format0o;
; [
I"IThe eql?
method returns true
if +obj+ and ;TI"O+other+ refer to the same hash key. This is used by Hash to test members ;TI"Pfor equality. For objects of class Object
, eql?
;TI"Lis synonymous with ==
. Subclasses normally continue this ;TI"Qtradition by aliasing eql?
to their overridden ==
;TI"Hmethod, but there are exceptions. Numeric
types, for ;TI"Mexample, perform type conversion across ==
, but not across ;TI"eql?
, so:;T@o;; [I"1 == 1.0 #=> true
;TI"1.eql? 1.0 #=> false;T;
0:
@fileI"
object.c;T:0@omit_headings_from_table_of_contents_below0I")obj.equal?(other) -> true or false;T0[ I" (p1);T@.FI"BasicObject;TcRDoc::NormalClass00