Class: Class

Inherits:
Object show all
Defined in:
lib/rubydraw/events.rb

Instance Method Summary collapse

Instance Method Details

#all_subclassesObject

Returns all subclasses. Credit goes to stackoverflow.com/questions/436159/how-to-get-all-subclasses



10
11
12
13
14
# File 'lib/rubydraw/events.rb', line 10

def all_subclasses
  result = []
  ObjectSpace.each_object(Class) { |klass| result << klass if klass < self }
  result
end