Class: Trailblazer::Operation::AutoInject::InjectStrategy
- Defined in:
- lib/trailblazer/operation/auto_inject.rb
Constant Summary collapse
- ClassMethods =
Class.new(Module)
Instance Attribute Summary collapse
-
#class_mod ⇒ Object
readonly
Returns the value of attribute class_mod.
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#dependency_map ⇒ Object
readonly
Returns the value of attribute dependency_map.
Instance Method Summary collapse
- #included(klass) ⇒ Object
-
#initialize(container, *dependency_names) ⇒ InjectStrategy
constructor
A new instance of InjectStrategy.
Methods included from Module
Constructor Details
#initialize(container, *dependency_names) ⇒ InjectStrategy
Returns a new instance of InjectStrategy.
14 15 16 17 18 |
# File 'lib/trailblazer/operation/auto_inject.rb', line 14 def initialize(container, *dependency_names) @container = container @dependency_map = Dry::AutoInject::DependencyMap.new(*dependency_names) @class_mod = ClassMethods.new end |
Instance Attribute Details
#class_mod ⇒ Object (readonly)
Returns the value of attribute class_mod.
12 13 14 |
# File 'lib/trailblazer/operation/auto_inject.rb', line 12 def class_mod @class_mod end |
#container ⇒ Object (readonly)
Returns the value of attribute container.
10 11 12 |
# File 'lib/trailblazer/operation/auto_inject.rb', line 10 def container @container end |
#dependency_map ⇒ Object (readonly)
Returns the value of attribute dependency_map.
11 12 13 |
# File 'lib/trailblazer/operation/auto_inject.rb', line 11 def dependency_map @dependency_map end |
Instance Method Details
#included(klass) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/trailblazer/operation/auto_inject.rb', line 20 def included(klass) define_call klass.singleton_class.prepend @class_mod super end |