Class: Payload::ServiceResolver Private
- Inherits:
-
Object
- Object
- Payload::ServiceResolver
- Defined in:
- lib/payload/service_resolver.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.
Encapsulates logic for resolving service definitions.
Used internally by Container. Use Container#service.
Instance Method Summary collapse
-
#initialize(block) ⇒ ServiceResolver
constructor
private
A new instance of ServiceResolver.
- #resolve(container, decorators) ⇒ Object private
Constructor Details
#initialize(block) ⇒ ServiceResolver
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 ServiceResolver.
8 9 10 |
# File 'lib/payload/service_resolver.rb', line 8 def initialize(block) @block = block end |
Instance Method Details
#resolve(container, decorators) ⇒ 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.
12 13 14 15 |
# File 'lib/payload/service_resolver.rb', line 12 def resolve(container, decorators) base = @block.call(container) decorators.decorate(base, container) end |