Class: Class

Inherits:
Object
  • Object
show all
Defined in:
lib/glimmer-dsl-opal/ext/class.rb

Instance Method Summary collapse

Instance Method Details

#descendantsObject



7
8
9
# File 'lib/glimmer-dsl-opal/ext/class.rb', line 7

def descendants
  @descendants.to_collection.map { |klass| [klass] + (klass.descendants if klass.respond_to?(:descendants)).to_a }.flatten.compact
end

#inherited(klass) ⇒ Object



2
3
4
5
# File 'lib/glimmer-dsl-opal/ext/class.rb', line 2

def inherited(klass)
  @descendants ||= []
  @descendants << klass
end