From: Jeremy Wells Date: 2006-12-19T21:55:36+09:00 Subject: Re: compare two objects without take its ID in consideration Lobosque Lucas wrote: > Is there a way to compare two objects without take its ID in > consideration? For example: > > # == > # > > It'll return false, because the object ID is different. But i want it to > return true, because the arguments (is it the right name?) are all > equal. > > Thanks > You can overwrite the == method: def ==(other_obj) true if self.str == other_obj.str and self.mdfel == other_obj.mdfel and self.name == other_obj.name end