>>>>> "L" == Lyle Johnson <ljohnson / resgen.com> writes:

L> I am writing a new class that's implemented by a C extension module and I
L> want to provide an equality test operator. I see that Ruby's Object class
L> has several synonymous functions for this ("==", "===" and "eql?").

 There are not really synonymous. You have in ruby-man

 self == other 

   Checks if two objects are equal. The default definition in the Kernel
   class checks by object ID. It should be redefined in subclasses
   according to the characteristic of the class.

 eql?(other) 

   Checks if two objects are equal. This method is used by Hash to compare
   whether two keys are same. When this method is redefined, the hash
   method should be updated.

 self === other 

  This method is used to compare in case. The default definitions is `=='. 

L> That appears to be the case when I look at some of Ruby's built-in classes,
L> but I wanted to confirm that the "==" and "===" aliases are automatically
L> inherited from class Object.

 If you define only eql?, == and === will be inherited from Object (or ...)
 and probably don't do what you want.


Guy Decoux