OK, according to the Pickaxe 2nd. Edition, Array#uniq judges uniqueness
based on eql?. Somehow this doesn’t seem to work for me :).
Following code returns the Array with two members instead of the one I
would wish for. Any pointers? I’m running 1.8.2
class A
attr_accessor :a,:b
def initialize a
@a=a
@b=Array.new
end
def << item
@b<<item
end
def eql? other
return true if @a==other.a && @b==other.b
end
def == other
return eql?(other)
end
end