class Class
def subclasses
class Baz < Bar; end
class Bar < Foo; end
class Foo; end
Returns an array with the direct children of +self+.
def subclasses descendants.select { |descendant| descendant.superclass == self } end unless ActiveSupport::RubyFeatures::CLASS_SUBCLASSES