module Xcake::CoreExtensions::ClassDescendants
@example Including in a class
extend Xcake::CoreExtensions::ClassDescendants
Public Instance Methods
descendants()
click to toggle source
Returns all descendants of a class
# 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