class Class

class Foo < ActiveRecord::Base end

Foo.inherits_from? ActiveRecord::Base

> true

Public Instance Methods

decendants() click to toggle source

show's live decendants of this class

# File lib/ckuru-tools.rb, line 285
def decendants
  CkuruTools.class_space.select {|x| x.inherits_from? self and x != self}
end
inherits_from?(klass) click to toggle source
# File lib/ckuru-tools.rb, line 289
def inherits_from?(klass)
  raise ArgumentError.new("argument must be of type Class") unless klass.is_a? Class
  if klass == self
    true
  elsif self.superclass.is_a? Class
    self.superclass.inherits_from? klass
  else
    false
  end
end