Method: SubclassAware#inherited

Defined in:
lib/classy/subclass_aware.rb

#inherited(sub) ⇒ Object

Add the inheriting class to the list of subclasses. Not intended to be called directly.

TODO: Find a way for self.inherited on the extended class not to blow this away without requiring a bunch of alias chain hoops to be jumped through, as described above.



64
65
66
# File 'lib/classy/subclass_aware.rb', line 64

def inherited(sub)
  class_exec { class_variable_get(:@@classy_subclasses).add sub }
end