From: Rob Biedenharn Date: 2008-05-24T02:14:58+09:00 Subject: Re: Module.===(X,X) is false On May 23, 2008, at 12:40 PM, calfeld@mac.com wrote: > I noticed that: > > class Foo > end > > Foo === Foo > > returns false. In particular, I can not do: > > i = Foo > case i > when Foo then ... > end > > I understand why Module.=== is true when it is, but is there a good > reason for it to be false in this case? Are their any plans for this > to change? > > Thanks, > Chris Alfeld but if you had: i = Foo.new Look at the docs for Class#=== ------------------------------------------------------------- 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. Does that help you? -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com