Method: Tap::Support::ConfigurableClass#inherited
- Defined in:
- lib/tap/support/configurable_class.rb
#inherited(child) ⇒ Object
When subclassed, the parent.configurations are duplicated and passed to the child class where they can be extended/modified without affecting the configurations of the parent class.
48 49 50 51 52 53 54 55 56 |
# File 'lib/tap/support/configurable_class.rb', line 48 def inherited(child) # :nodoc: unless child.instance_variable_defined?(:@source_file) caller.first =~ Lazydoc::CALLER_REGEXP child.instance_variable_set(:@source_file, File.($1)) end child.instance_variable_set(:@configurations, ClassConfiguration.new(child, @configurations)) super end |