From: Greg Hauptmann Date: 2009-09-05T20:51:28+09:00 Subject: Re: how to compare two object instances? is "m1.to_yaml.eql?(m2.to_yaml)" a good way? actually I just saw this posted on "http://www.reddit.com/r/ruby/comments/9540i/ruby_developers_make_sure_you_define_eql_and_hash/" that might be good... def eql?(other) return false unless other.class == self.class return false unless other.instance_variables == self.instance_variables self.instance_variables.each do |var| self_var = self.instance_variable_get(var) other_var = other.instance_variable_get(var) return false unless self_var.eql?(other_var) end true; end