Module: Xcake::CoreExtensions::ClassDescendants
- Included in:
- Generator, Plugin::ClassMethods
- Defined in:
- lib/xcake/core_ext/class.rb
Overview
Instance Method Summary collapse
-
#descendants ⇒ Object
Returns all descendants of a class.
Instance Method Details
#descendants ⇒ Object
Returns all descendants of a class
9 10 11 |
# File 'lib/xcake/core_ext/class.rb', line 9 def descendants ObjectSpace.each_object(singleton_class).select { |klass| klass < self }.sort_by(&:to_s) end |