From: Dave Thomas Date: 2002-04-13T00:32:30+09:00 Subject: Re: Why Object#class Is Inconsistent in "==" and "case"? William Djaja Tjokroaminata writes: > Thanks for the example. I can see that in the case statement involving > object, it behaves just like the "kind_of?" method. > > However, in the "Programming Ruby" book, this is what is written: > > ----------------------------- > Object > == > Equality---At the Object level, == returns true only if obj and anObj are > the same object. Typically this method is overridden... > === > Case Equality---A synonym for Object#==, but typically overridden... > ----------------------------- > > Can I say, then, that the "Programming Ruby" book is wrong in this > case? With the simple example, there is nothing that overrides the > "===" operator, isn't there? Should I find another Ruby book now, the > nutshell by Mr. Matz, perhaps? You're using Module#===, not Object#=== in your example. Dave