Class: SmartCore::Injection::Locator Private
- Inherits:
-
Object
- Object
- SmartCore::Injection::Locator
- Defined in:
- lib/smart_core/injection/locator.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: Factory Classes: ContainerProxy, Dependency
Instance Attribute Summary collapse
- #import_path ⇒ String readonly private
Instance Method Summary collapse
- #initialize(import_path, container_proxy, memoize_dependency:) ⇒ void constructor private
- #rebind_dependency ⇒ Any (also: #rebind!) private
- #resolve_dependency ⇒ Any (also: #bind!) private
Constructor Details
#initialize(import_path, container_proxy, memoize_dependency:) ⇒ 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.
25 26 27 28 29 30 |
# File 'lib/smart_core/injection/locator.rb', line 25 def initialize(import_path, container_proxy, memoize_dependency:) @import_path = import_path @container_proxy = container_proxy @memoize_dependency = memoize_dependency @dependency = SmartCore::Injection::Locator::Dependency.new(memoize: memoize_dependency) end |
Instance Attribute Details
#import_path ⇒ String (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.
15 16 17 |
# File 'lib/smart_core/injection/locator.rb', line 15 def import_path @import_path end |
Instance Method Details
#rebind_dependency ⇒ Any Also known as: rebind!
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.
45 46 47 |
# File 'lib/smart_core/injection/locator.rb', line 45 def rebind_dependency dependency.rebind { container_proxy.resolve_dependency(import_path) } end |
#resolve_dependency ⇒ Any Also known as: bind!
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.
36 37 38 |
# File 'lib/smart_core/injection/locator.rb', line 36 def resolve_dependency dependency.bind { container_proxy.resolve_dependency(import_path) } end |