Class: Class
- Inherits:
-
Object
- Object
- Class
- Defined in:
- lib/cli/core_ext.rb
Instance Method Summary collapse
-
#subclasses ⇒ Object
Public: Handy ! Returns all subclasses of a specific class.
Instance Method Details
#subclasses ⇒ Object
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 |