Module: Dbee::Dsl::Reflectable

Included in:
Base
Defined in:
lib/dbee/dsl/reflectable.rb

Overview

Provide methods for dealing with introspection of class hierarchies.

Instance Method Summary collapse

Instance Method Details

#reversed_subclasses(base_class_constant) ⇒ Object

Start at parent, end with child



20
21
22
# File 'lib/dbee/dsl/reflectable.rb', line 20

def reversed_subclasses(base_class_constant)
  subclasses(base_class_constant).reverse
end

#subclasses(base_class_constant) ⇒ Object

Start at child, end with parent



15
16
17
# File 'lib/dbee/dsl/reflectable.rb', line 15

def subclasses(base_class_constant)
  ancestors.select { |a| a < base_class_constant }
end