[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: case question
From:       Caleb Tennis <caleb () aei-tech ! com>
Date:       2006-01-10 13:16:22
Message-ID: 200601100815.52168.caleb () aei-tech ! com
[Download RAW message or body]


> can I assume that === is in this context the same as kind_of?
> or are there subtle differences between them

=== by default calls == unless you specifically override it in your 
implementation.

Module overrides it (which means that Class overrides it as well).

I think it's probably safe to say that === is in the same context as kind_of?, 
at least for classes:

irb(main):009:0> NilClass === nil
=> true
irb(main):010:0> nil === NilClass
=> false

Caleb

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic