From: nobu.nokada@... Date: 2002-03-14T02:17:17+09:00 Subject: Re: key comparision inside Hash Hi, At Wed, 13 Mar 2002 22:27:06 +0900, Vladimir Dozen wrote: > def <=> (another) > @a <=> another.a || @b <=> another.b > end This may not work as you want. Generally <=> method returns, -1, 1 or 0, not nil. You need to write as: def <=> (another) (@a <=> another.a).nonzero? || @b <=> another.b end -- Nobu Nakada