Module: Listing::ClassMethods

Defined in:
lib/nose/util.rb

Overview

Add a class method to track new subclasses

Instance Method Summary collapse

Instance Method Details

#inherited(subclass) ⇒ void

This method returns an undefined value.

Track this new subclass for later



306
307
308
# File 'lib/nose/util.rb', line 306

def inherited(subclass)
  class_variable_get(:@@registry)[subclass.name] = subclass
end

#subclassesHash<String, Class>

List all of the encountered subclasses

Returns:

  • (Hash<String, Class>)


312
313
314
# File 'lib/nose/util.rb', line 312

def subclasses
  class_variable_get(:@@registry)
end