From: Ryan Davis Date: 2011-12-31T06:59:26+09:00 Subject: Re: Hash access On Dec 30, 2011, at 00:59 , Josh Cheek wrote: > I see. The confusion for me was that the comparison goes in the other > direction. (ie hash["Josh"] turns into "Josh".eql?(#) but > I was thinking it would be #.eql?("Josh")). This becomes > apparent if I change the log line to `puts "#{inspect} was asked if they > were #eql? to #{other.inspect}"` I just didn't do that in the name of > brevity, and it masked the discrepancy. The other confusion for you is insisting it is eql? instead of ==. Yong Li nailed the description of how it works. Please read it again. It is as close to perfect as we're going to get. Also, as pointed out on the other hash thread... There _needs_ to be a 1:1 correlation between the result of #== and the result of #hash. You cannot simply use the "most relevant attribute". You _must_ use _all_ the attributes that you use against equality tests. Doing this is fundamental to ruby (and computer science) and must be thoroughly understood.