Module: SmartCore::Container::Mixin::ClassInheritance Private

Defined in:
lib/smart_core/container/mixin.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.5.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:

  • child_klass (CLass)

Since:

  • 0.5.0



34
35
36
37
38
39
40
41
42
43
# File 'lib/smart_core/container/mixin.rb', line 34

def inherited(child_klass)
  inherited_container_klass = Class.new(@__smart_core_container_klass__)

  child_klass.instance_variable_set(:@__smart_core_container_access_lock__, Mutex.new)
  child_klass.instance_variable_set(:@__smart_core_container_definition_lock__, Mutex.new)
  child_klass.instance_variable_set(:@__smart_core_container_klass__, inherited_container_klass)
  child_klass.instance_variable_set(:@__smart_core_container__, nil)

  super
end