From: "Jesús Gabriel y Galán" Date: 2010-08-06T18:15:43+09:00 Subject: Re: lt operator on class object, checking a class' superclasses On Fri, Aug 6, 2010 at 10:57 AM, Tomasz Wrobel wrote: > Hi! > > Do you know a good way to check whether a class is a subclass of a > certain class (given the class object, not an instance)? > > one way would be to check all of klass.superclass, > klass.superclass.superclass till nil > > or klass.new.is_a?( cklass ) Klass.ancestors.include?(Ancestor) For example: irb(main):003:0> String.ancestors.include? Object => true Jesus.