Class: Corindon::DependencyInjection::Token::ServiceFactoryToken
- Inherits:
-
InjectionToken
- Object
- InjectionToken
- Corindon::DependencyInjection::Token::ServiceFactoryToken
- Defined in:
- lib/corindon/dependency_injection/token/service_factory_token.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(service, method) ⇒ ServiceFactoryToken
constructor
A new instance of ServiceFactoryToken.
- #resolve(injector:) ⇒ Object
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
#method ⇒ Object (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 |
#service ⇒ Object (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
18 19 20 |
# File 'lib/corindon/dependency_injection/token/service_factory_token.rb', line 18 def resolve(injector:) [injector.resolve(service), method] end |