Class: SmartCore::Container::Entities::Namespace Private
- 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.
Instance Attribute Summary collapse
- #host_container ⇒ NilClass, SmartCore::Container readonly private
Attributes inherited from Base
Instance Method Summary collapse
- #append_definitions(dependencies_definition) ⇒ void private
- #freeze! ⇒ void private
- #initialize(namespace_name, host_container = SmartCore::Container::NO_HOST_CONTAINER) ⇒ void constructor private
- #reveal(runtime_host_container = SmartCore::Container::NO_HOST_CONTAINER) ⇒ SmartCore::Container private
Constructor Details
#initialize(namespace_name, host_container = SmartCore::Container::NO_HOST_CONTAINER) ⇒ 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.
26 27 28 29 30 31 32 |
# File 'lib/smart_core/container/entities/namespace.rb', line 26 def initialize(namespace_name, host_container = SmartCore::Container::NO_HOST_CONTAINER) super(namespace_name) @container_klass = Class.new(SmartCore::Container) @container_instance = nil @host_container = host_container @lock = SmartCore::Engine::ReadWriteLock.new end |
Instance Attribute Details
#host_container ⇒ NilClass, SmartCore::Container (readonly)
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.
17 18 19 |
# File 'lib/smart_core/container/entities/namespace.rb', line 17 def host_container @host_container 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.
49 50 51 |
# File 'lib/smart_core/container/entities/namespace.rb', line 49 def append_definitions(dependencies_definition) @lock.write_sync { 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.
57 58 59 |
# File 'lib/smart_core/container/entities/namespace.rb', line 57 def freeze! @lock.write_sync { container_instance.freeze! } end |
#reveal(runtime_host_container = SmartCore::Container::NO_HOST_CONTAINER) ⇒ SmartCore::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.
40 41 42 |
# File 'lib/smart_core/container/entities/namespace.rb', line 40 def reveal(runtime_host_container = SmartCore::Container::NO_HOST_CONTAINER) @lock.read_sync { container_instance(runtime_host_container) } end |