Class: SmartCore::Container Private
- Inherits:
-
Object
- Object
- SmartCore::Container
- Includes:
- DefinitionDSL
- Defined in:
- lib/smart_core/container.rb,
lib/smart_core/container/registry.rb,
lib/smart_core/container/exceptions.rb,
lib/smart_core/container/command_definer.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.
Defined Under Namespace
Modules: Commands, DefinitionDSL, DependencyBuilder, DependencyCompatability, DependencyResolver, KeyGuard, Mixin, RegistryBuilder Classes: CommandDefiner, CommandSet, Dependency, Entity, MemoizedDependency, Namespace, Registry
Constant Summary collapse
- Error =
Class.new(SmartCore::Error)
- ArgumentError =
Class.new(SmartCore::ArgumentError)
- NamespaceOverlapError =
Class.new(Error)
- DependencyOverlapError =
Class.new(Error)
- UnexistentDependencyError =
Class.new(Error)
- FrozenRegistryError =
Class.new(SmartCore::FrozenError)
- IncompatibleDependencyTree =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Class.new(Error)
Instance Method Summary collapse
- #freeze ⇒ void
- #frozen? ⇒ Boolean
- #initialize ⇒ void constructor
- #namespace(namespace_name, &dependency_definitions) ⇒ void
- #register(dependency_name, **options, &dependency_definition) ⇒ void
- #reload! ⇒ void
- #resolve(dependency_path) ⇒ Any
Methods included from DefinitionDSL
Constructor Details
#initialize ⇒ void
32 33 34 35 |
# File 'lib/smart_core/container.rb', line 32 def initialize build_registry @access_lock = Mutex.new end |
Instance Method Details
#freeze ⇒ void
This method returns an undefined value.
56 57 58 |
# File 'lib/smart_core/container.rb', line 56 def freeze thread_safe { registry.freeze } end |
#frozen? ⇒ Boolean
64 65 66 |
# File 'lib/smart_core/container.rb', line 64 def frozen? thread_safe { registry.frozen? } end |
#namespace(namespace_name, &dependency_definitions) ⇒ void
This method returns an undefined value.
74 75 76 77 78 |
# File 'lib/smart_core/container.rb', line 74 def namespace(namespace_name, &dependency_definitions) thread_safe do registry.namespace(namespace_name, &dependency_definitions) end end |
#register(dependency_name, **options, &dependency_definition) ⇒ void
TODO:
option list
This method returns an undefined value.
46 47 48 49 50 |
# File 'lib/smart_core/container.rb', line 46 def register(dependency_name, **, &dependency_definition) thread_safe do registry.register(dependency_name, **, &dependency_definition) end end |
#reload! ⇒ void
This method returns an undefined value.
95 96 97 |
# File 'lib/smart_core/container.rb', line 95 def reload! thread_safe { build_registry } end |
#resolve(dependency_path) ⇒ Any
85 86 87 88 89 |
# File 'lib/smart_core/container.rb', line 85 def resolve(dependency_path) thread_safe do DependencyResolver.resolve(registry, dependency_path) end end |