From: Mark Dodwell Date: 2006-12-19T22:43:02+09:00 Subject: Re: compare two objects without take its ID in consideration This just gets the representation of both of the objects as strings (the 'inspect') part. Then it strips out the Object ID (the 'sub') part using a regular expression. It's a bit ugly though. It would be better to add an attribute to your object which acts as a identifier for that object (in the real world), then you can simply compare that to check two objects are the same. For example: obj1.my_id == obj2.my_id Hope that makes sense, Mark -- Posted via http://www.ruby-forum.com/.