equal?

equal?

ri

 ---------------------------------------------------------- Object#equal?
      obj == other        => true or false
      obj.equal?(other)   => true or false
      obj.eql?(other)     => true or false
 ------------------------------------------------------------------------
      Equality---At the  Object  level,  ==  returns  true  only if _obj_
      and _other_ are the same object. Typically, this method is
      overridden in descendent classes to provide class-specific meaning.
 
      Unlike  == , the  equal?  method should never be overridden by
      subclasses: it is used to determine object identity (that is,
       a.equal?(b)  iff  a  is the same object as  b ).
 
      The  eql?  method returns  true  if _obj_ and _anObject_ have the
      same value. Used by  Hash  to test members for equality. For
      objects of class  Object ,  eql?  is synonymous with  == .
      Subclasses normally continue this tradition, but there are
      exceptions.  Numeric  types, for example, perform type conversion
      across  == , but not across  eql? , so:
 
         1 == 1.0     #=> true
         1.eql? 1.0   #=> false
 

refe

 Object#equal?
 --- equal?(other)
 
     other が self 自身の時、真を返します。
     このメソッドを再定義してはいけません。