Class: SmartCore::Container::Namespace Private

Inherits:
Entity
  • Object
show all
Defined in:
lib/smart_core/container/namespace.rb

Overview

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

Since:

  • 0.5.0

Instance Attribute Summary

Attributes inherited from Entity

#external_name

Instance Method Summary collapse

Constructor Details

#initialize(external_name) ⇒ 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.

Parameters:

  • external_name (String)

Since:

  • 0.5.0



11
12
13
14
15
16
# File 'lib/smart_core/container/namespace.rb', line 11

def initialize(external_name)
  @container = Class.new(SmartCore::Container)
  @container_instance = nil
  @access_lock = Mutex.new
  super(external_name)
end

Instance Method Details

#append_definitions(dependency_definitions) ⇒ 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:

  • dependency_definitions (Proc)

Since:

  • 0.5.0



23
24
25
# File 'lib/smart_core/container/namespace.rb', line 23

def append_definitions(dependency_definitions)
  container.instance_eval(&dependency_definitions)
end

#callSmartCore::Container

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.

Returns:

Since:

  • 0.5.0



31
32
33
# File 'lib/smart_core/container/namespace.rb', line 31

def call
  thread_safe { @container_instance ||= container.new }
end