From: Zakaria Date: 2004-06-18T06:12:38+09:00 Subject: How to make generic #== method? Hi, Currently I got many simple class which is just a simple record-like. An example ----------------------------------- class LoopTag # :nodoc: attr_reader :param attr_reader :contents def initialize(param) @param, @contents = param, [] end def ==(other) return false unless other.class == self.class return other.param == @param && other.contents == @contents end end ------------------------------------ and I got a couple more class like this. Is there a way to make a generic #== or some Module that I can include ? I surely need it to do assert_equal on unit test. You know, I just waste a couple hour tracking bug that doesn't exists because I forgot to implement #== :) TIA, -- Zakaria z4k4ri4@bigfoot.com Yahoo!: z4k4ri4 http://zakaria.is-a-geek.org http://pemula.linux.or.id