Module: SmartCore::Container::DefinitionDSL::ClassInheritance Private

Defined in:
lib/smart_core/container/definition_dsl.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.7.0

Instance Method Summary collapse

Instance Method Details

#inherited(child_klass) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

Since:

  • 0.7.0



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/smart_core/container/definition_dsl.rb', line 35

def inherited(child_klass)
  child_klass.instance_variable_set(:@__container_definition_commands__, CommandSet.new)
  child_klass.instance_variable_set(:@__container_instantiation_commands__, CommandSet.new)
  child_klass.instance_variable_set(:@__container_definition_lock__, ArbitaryLock.new)

  child_klass.__container_definition_commands__.concat(
    __container_definition_commands__
  )

  child_klass.__container_instantiation_commands__.concat(
    __container_instantiation_commands__
  )

  child_klass.singleton_class.prepend(ClassInheritance)
  super
end