From: dblack@... Date: 2007-06-07T05:26:11+09:00 Subject: Re: === operator Hi -- On Thu, 7 Jun 2007, Jon Leighton wrote: > Hi, > >>> {} === Hash > => false >>> case {} >>> when Hash then true >>> end > => true >>> Hash === {} > => true > > Why is the first statement false when the second is true? I understand > case uses === to compare the objects? Perhaps it switches them round as > in the last statement? Yes; === is called on the when expression(s), with the case object as argument. David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)