Hi.
In message "[ruby-talk:00281] 'case' question"
on 99/04/14, "bryce" <thecrow / cyberdude.com> writes:
|but this code, which I thought would be equivalent
|does not work.
|
| case e.type
| when BNClicked
| print "\nGot BNClicked"
| end
|
|Am I missing the reason why?
Because you should write this as:
> case e
> when BNClicked
> print "\nGot BNClicked"
> end
It's because case comparison is done by operator ===, which works as
`kind_of?' for classes and modules.
matz.