Class: Payload::ServiceResolver Private

Inherits:
Object
  • Object
show all
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

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