From: Robert Klemme Date: 2010-06-04T19:51:14+09:00 Subject: Re: comparing objects 2010/6/4 Marcin Wolski : > Robert Dober wrote: >> On Fri, Jun 4, 2010 at 3:41 AM, Marcin Wolski wrote: >> >>> �def ==(other) >>> �@email == other.email >>> �end >> this seems ok >>> >>> �alias eql? == >>> >>> �def hash >>> � �code = 17 >>> � �code = 37*code + @email.hash >>> end >>> >> Are you sure you want to do this? "equal" objects would overwrite each >> other when used as hash keys. This is normally not a good idea, be >> sure you really want/need this! Absolutely agree! > What would be the other possible solution to this problem? Actually I am not sure what the problem actually is. Does OP want to return all objects which are in both Arrays? Does he want to return all objects which share a particular set of properties? etc. Before we can provide solutions we have to know what problem must be solved. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/