The documents you are referencing clearly indicate (my attention):
The equality of each pair of elements is determined according to Object#eql?
andObject#hash , since it is Setused Hashas storage.
Hash, eql?, :
f1, f2 = Foo.new, Foo.new
p f1.eql?(f2)
p f1.hash==f2.hash
p Set[f1,f2].length
class Foo
def hash
[bar,hash].hash
end
end
f1, f2 = Foo.new, Foo.new
p f1.eql?(f2)
p f1.hash==f2.hash
p Set[f1,f2].length
, , Hash , .