[MacRuby-devel] is_a? method

Dave Baldwin dave.baldwin at dsl.pipex.com
Wed Jan 19 13:14:12 PST 2011


Have you tried kind_of? method, 

i.e. 

class AnArray < Array
end

a = AnArray.new

a.kind_of? Array   		will return true
a.kind_of? String			will return false

assuming I haven't miss understood your question.

Dave.

On 19 Jan 2011, at 21:06, Robert Rice wrote:

> Hi:
> 
> I notice that the obj.is_a? method does not work on a class constant. It only works on an instance of the class.
> 
> Is this the way it should work? Do I need to create a loop checking using the superclass method to check the inheritance of a class or is there an easier way?
> 
> Thanks,
> Bob Rice
> 
> _______________________________________________
> 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