[MacRuby-devel] is_a? method
Robert Rice
rice.audio at pobox.com
Sat Jan 29 15:15:37 PST 2011
Hi Eric:
Thanks, the ancestors method will work better.
Do class objects inherit all of the Module methods?
Bob Rice
On Jan 29, 2011, at 1:22 AM, Eric Christopherson wrote:
> On Wed, Jan 19, 2011 at 5:15 PM, Caio Chassot <lists at caiochassot.com> wrote:
>> On 2011-01-19, at 20:50 , Robert Rice wrote:
>>>
>>> You instantiated AnArray. Try this:
>>>
>>> class AnArray < Array; end
>>>
>>> AnArray.kind_of?( Array ) will return false
>>
>> Is this what you're looking for?
>>
>> $ macirb
>> irb(main):001:0> class AnArray < Array; end
>> => nil
>> irb(main):002:0> AnArray <= Array
>> => true
>
> Or:
>
> AnArray.ancestors.include? Array
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
More information about the MacRuby-devel
mailing list