From: Spitfire Date: 2006-12-22T19:50:07+09:00 Subject: Re: class method Gregor Kopp wrote: > Spitfire schrieb: >> Gregor Kopp wrote: >> >>>> sample = [1,2,3] >>>> p sample.class #=> Array >>>> p sample.is_a?(Array) #=> true >>> >>> >>> isa? makes checks with .class in the Background automagically. >> >> so what is exactly happening when I type >> sample.class.is_a?... >> >> > > i think it does a check with samle.class.class in the Background wich > results in Class > > irb(main):001:0> class A > irb(main):002:1> end > => nil > irb(main):003:0> a = A.new > => # > irb(main):004:0> a.class > => A isn't this 'A' the class 'A'??? if so when I'm checking for a type of this, it should return true right??? I'm sorry if I'm still not grasping the concept. > irb(main):005:0> a.class.is_a? A > => false this still confuses me! -- _ _ _]{5pitph!r3}[_ _ _ __________________________________________________ �I'm smart enough to know that I'm dumb.� - Richard P Feynman