From: David Chelimsky Date: 2007-01-20T05:15:48+09:00 Subject: Re: TrueClass === TrueClass On 1/19/07, Vincent Fourmond wrote: > Bojan Mihelac wrote: > > Hi all, > > why is: > > > > TrueClass === TrueClass # false > > Object === Object # true > > > > Documentation states that === method is used to provide meaningful > > semantic in case statements. Can anyone explain me why some classes > > returns false? > > === returns true with one class if you 'compare' it to an instance of > the class: > > irb(main):002:0> TrueClass == TrueClass > => true > irb(main):003:0> TrueClass === TrueClass > => false > irb(main):004:0> TrueClass === true > => true > > Cheers, Ah - so Object === Object returns true because the second Object is an instance of the first Object. How deceiving. > > Vince > > -- > Vincent Fourmond, PhD student > http://vincent.fourmond.neuf.fr/ > >