Class: Flows::Plugin::DependencyInjector::DependencyList Private
- Inherits:
-
Object
- Object
- Flows::Plugin::DependencyInjector::DependencyList
- Defined in:
- lib/flows/plugin/dependency_injector/dependency_list.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.
Resolves dependencies on initialization and can inject it into class instance.
Instance Attribute Summary collapse
- #definitions ⇒ Object readonly private
- #dependencies ⇒ Object readonly private
- #provided_values ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(klass:, definitions:, provided_values:) ⇒ DependencyList
constructor
private
A new instance of DependencyList.
- #inject_to(instance) ⇒ Object private
Constructor Details
#initialize(klass:, definitions:, provided_values:) ⇒ DependencyList
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 a new instance of DependencyList.
10 11 12 13 14 15 16 17 18 |
# File 'lib/flows/plugin/dependency_injector/dependency_list.rb', line 10 def initialize(klass:, definitions:, provided_values:) @klass = klass @definitions = definitions @provided_values = provided_values.dup.tap { |pv| pv.default = NO_VALUE } check_missing_dependencies check_unexpected_dependencies resolve_dependencies end |
Instance Attribute Details
#definitions ⇒ Object (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.
8 9 10 |
# File 'lib/flows/plugin/dependency_injector/dependency_list.rb', line 8 def definitions @definitions end |
#dependencies ⇒ Object (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.
8 9 10 |
# File 'lib/flows/plugin/dependency_injector/dependency_list.rb', line 8 def dependencies @dependencies end |
#provided_values ⇒ Object (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.
8 9 10 |
# File 'lib/flows/plugin/dependency_injector/dependency_list.rb', line 8 def provided_values @provided_values end |
Instance Method Details
#inject_to(instance) ⇒ Object
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.
20 21 22 |
# File 'lib/flows/plugin/dependency_injector/dependency_list.rb', line 20 def inject_to(instance) dependencies.each { |dep| dep.inject_to(instance) } end |