From: Adam Gardner Date: 2009-05-14T02:02:07+09:00 Subject: Re: Why Fixnum===Fixnum is false? Joel VanderWerf wrote: > Fixnum is not an instance of Fixnum. Compare: > > ------------------------------------------------------------- Object#=== > obj === other => true or false > > From Ruby 1.8 > ------------------------------------------------------------------------ > Case Equality---For class Object, effectively the same as calling > #==, but typically overridden by descendents to provide meaningful > semantics in case statements. > > ------------------------------------------------------------- Module#=== > mod === obj => true or false > > From Ruby 1.8 Uh, I think you omitted the most important part of the documentation, to whit, what it actually says about Module#===: ------------------------------------------------------------- Module#=== mod === obj => true or false ------------------------------------------------------------------------ Case Equality---Returns +true+ if _anObject_ is an instance of _mod_ or one of _mod_'s descendents. Of limited use for modules, but can be used in +case+ statements to classify objects by class. (and incidentally, it is also important to know that the class 'Class' does not define it's own #=== method, and so inherits from Module, which is hinted at but not explicitly stated here) -- Posted via http://www.ruby-forum.com/.