Class: SmartCore::Container::Entities::Namespace Private

Inherits:
Base
  • Object
show all
Defined in:
lib/smart_core/container/entities/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.7.0

Instance Attribute Summary

Attributes inherited from Base

#external_name

Instance Method Summary collapse

Constructor Details

#initialize(namespace_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:

  • namespace_name (String)

Since:

  • 0.7.0



17
18
19
20
21
22
# File 'lib/smart_core/container/entities/namespace.rb', line 17

def initialize(namespace_name)
  super(namespace_name)
  @container_klass = Class.new(SmartCore::Container)
  @container_instance = nil
  @lock = SmartCore::Container::ArbitaryLock.new
end

Instance Method Details

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

  • dependencies_definition (Proc)

Since:

  • 0.7.0



37
38
39
# File 'lib/smart_core/container/entities/namespace.rb', line 37

def append_definitions(dependencies_definition)
  thread_safe { container_klass.instance_eval(&dependencies_definition) }
end

#freeze!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.

Since:

  • 0.7.0



45
46
47
# File 'lib/smart_core/container/entities/namespace.rb', line 45

def freeze!
  thread_safe { container_instance.freeze! }
end

#resolveSmartCore::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.7.0



28
29
30
# File 'lib/smart_core/container/entities/namespace.rb', line 28

def resolve
  thread_safe { container_instance }
end