Class: Class

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#subclassesObject

Public: Handy ! Returns all subclasses of a specific class.

Returns an Array of Classes.



5
6
7
# File 'lib/cli/core_ext.rb', line 5

def subclasses
  ObjectSpace.each_object(Class).select {  |klass| klass < self }
end