From: Eric Hodel Date: 2007-01-30T17:10:51+09:00 Subject: Re: Sane #hash implementation? On Jan 29, 2007, at 23:26, Shot (Piotr Szotkowski) wrote: > Eric Hodel: >> On Jan 29, 2007, at 14:38, Shot (Piotr Szotkowski) wrote: >>> I�m stuck when it comes to Block#hash, though; I need these to be >>> true: >>> Block.new.hash == Block.new.hash >>> Block.new([1,2]).hash == Block.new([1,2]).hash > >> Try: > >> class Block >> def hash >> to_a.hash >> end >> end > > Thanks a lot, Eric! This is the �d�oh!� solution I was looking for. :) You may want to define #eql? in terms of #to_a as well...