Ruby API says:
The eql? method returns true if obj and other refer to the same hash key.
I changed the hash method for Object
:
class Object
def hash
1
end
end
Object.new.hash == Object.new.hash
# => true
Object.new.eql? Object.new
# => false
I don't understand why the second statement returns false
; according to Ruby Object API above, it should return true
.