On Thu, Dec 29, 2011 at 4:06 PM, Nikolai Weibull <now / bitwi.se> wrote: > On Thu, Dec 29, 2011 at 15:52, Gunther Diemant <g.diemant / gmx.net> wrote: >> I think you can't access instance variables from a class method, so >> both methods are kinda useless. > > Ugh, that should of course be > > class A > ¨Âåæ èáóè > > ¨Âîä > end Easy way: class A def hash [@a, @b, @c].hash end end Easiest: # also gives you == and eql? A = Struct.new :a, :b, :c Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/