From: "daniel åkerud" Date: 2007-10-29T17:43:28+09:00 Subject: uniq on custom objects ------=_Part_1324_22661797.1193647403030 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I cannot get uniq to work with an array of custom class-objects. It seems overriding hash is now enough. This is what I mean: class Obj attr_reader :name, :number def initialize(name, number) @name = name @number = number end def hash return @name.hash end end a = [Obj.new("apa", 1), Obj.new("apa", 2), Obj.new("smisk", 3)] => [#, #, #] a.uniq => [#, #, #] But i want only one instance of "apa", and it doesn't matter which. Is there something else I have to override? /D ------=_Part_1324_22661797.1193647403030--