Daniel Schüle
1/10/2006 2:34:00 AM
Caleb Tennis wrote:
>>
>> it must miss something
>> Any ideas?
>>
>>
>
> case comparisons are done using ===.
>
> irb(main):017:0> nil.class === NilClass
> => false
> irb(main):018:0> nil.class == NilClass
> => true
>
> For classes/modules, it's used to determine if an instance is a
> descendant:
nil.kind_of? NilClass
can I assume that === is in this context the same as kind_of?
or are there subtle differences between them
> irb(main):027:0> 5 === Fixnum
> => false
> irb(main):028:0> Fixnum === 5
> => true
>
> Caleb
thanks to both, this helps