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