Gregor Kopp
12/22/2006 10:34:00 AM
Gregor Kopp schrieb:
> Spitfire schrieb:
>
>> One thing that I don't understand is the following code.
>>
>> sample = [1,2,3]
>> p sample.class #=> Array
>> p sample.class.is_a?(Array) #=> false
>> p sample.class.is_a?(Array.class) #=> true (why???)
>>
>
> sample = [1,2,3]
> p sample.class #=> Array
> p sample.is_a?(Array) #=> true
isa? makes checks with .class in the Background automagically.