From: Gregor Kopp Date: 2006-12-22T19:45:05+09:00 Subject: Re: class method 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 irb(main):005:0> a.class.is_a? A => false irb(main):006:0> a.class.class => Class irb(main):007:0> A.class => Class