"Robert Dober" <robert.dober / gmail.com> writes:

> The eql? method returns true if *obj* and *anObject* have the same value.
> Used by Hash <http://www.ruby-doc.org/core/classes/Hash.html> to test
> members for equality. For objects of class
> Object<http://www.ruby-doc.org/core/classes/Object.html>,
> eql? is synonymous with ==. Subclasses normally continue this tradition, but
> there are exceptions.

Note something that's peripherally related to == and eql? is the
method "hash", which subclasses MUST override if they override eql? or
== so that the guarantee:

   a.eql?(b) implies a.hash == b.hash

is maintained.  If you don't do this, your new objects will do all
sorts of weird things when you try to use them as keys in a Hash or
elements in a Set.