Class: Corindon::DependencyInjection::Token::ServiceFactoryToken

Inherits:
InjectionToken
  • Object
show all
Defined in:
lib/corindon/dependency_injection/token/service_factory_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service, method) ⇒ ServiceFactoryToken

Returns a new instance of ServiceFactoryToken.



10
11
12
13
14
15
# File 'lib/corindon/dependency_injection/token/service_factory_token.rb', line 10

def initialize(service, method)
  super()

  @service = service
  @method = method
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method.



8
9
10
# File 'lib/corindon/dependency_injection/token/service_factory_token.rb', line 8

def method
  @method
end

#serviceObject (readonly)

Returns the value of attribute service.



7
8
9
# File 'lib/corindon/dependency_injection/token/service_factory_token.rb', line 7

def service
  @service
end

Instance Method Details

#resolve(injector:) ⇒ Object

Parameters:



18
19
20
# File 'lib/corindon/dependency_injection/token/service_factory_token.rb', line 18

def resolve(injector:)
  [injector.resolve(service), method]
end