Class: Dry::AutoInject::Builder
- Inherits:
-
Object
- Object
- Dry::AutoInject::Builder
- Defined in:
- lib/dry/auto_inject/builder.rb
Instance Attribute Summary collapse
- #container ⇒ Object readonly private
- #strategies ⇒ Object readonly private
Instance Method Summary collapse
- #[](*dependency_names) ⇒ Object
-
#initialize(container, options = {}) ⇒ Builder
constructor
A new instance of Builder.
- #respond_to_missing?(name, _include_private = false) ⇒ Boolean
Constructor Details
#initialize(container, options = {}) ⇒ Builder
Returns a new instance of Builder.
15 16 17 18 |
# File 'lib/dry/auto_inject/builder.rb', line 15 def initialize(container, = {}) @container = container @strategies = .fetch(:strategies) { Strategies } end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Attribute Details
#container ⇒ 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.
7 8 9 |
# File 'lib/dry/auto_inject/builder.rb', line 7 def container @container end |
#strategies ⇒ 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.
10 11 12 |
# File 'lib/dry/auto_inject/builder.rb', line 10 def strategies @strategies end |
Instance Method Details
#[](*dependency_names) ⇒ Object
21 22 23 |
# File 'lib/dry/auto_inject/builder.rb', line 21 def [](*dependency_names) default[*dependency_names] end |
#respond_to_missing?(name, _include_private = false) ⇒ Boolean
25 26 27 |
# File 'lib/dry/auto_inject/builder.rb', line 25 def respond_to_missing?(name, _include_private = false) strategies.key?(name) end |