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.1.0

Version:

  • 0.11.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.1.0

Version:

  • 0.11.0



37
38
39
40
41
42
43
44
45
46
# File 'lib/smart_core/container/mixin.rb', line 37

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

  # rubocop:disable Layout/LineLength
  child_klass.instance_variable_set(:@__smart_core_container_access_lock__, SmartCore::Engine::ReadWriteLock.new)
  child_klass.instance_variable_set(:@__smart_core_container_klass__, inherited_container_klass)
  child_klass.instance_variable_set(:@__smart_core_container__, nil)
  # rubocop:enable Layout/LineLength
  super
end