Class: Corindon::DependencyInjection::Token::ParameterToken
- Inherits:
-
InjectionToken
- Object
- InjectionToken
- Corindon::DependencyInjection::Token::ParameterToken
- Defined in:
- lib/corindon/dependency_injection/token/parameter_token.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key:) ⇒ ParameterToken
constructor
A new instance of ParameterToken.
- #resolve(injector:) ⇒ Object
Constructor Details
#initialize(key:) ⇒ ParameterToken
Returns a new instance of ParameterToken.
9 10 11 12 13 |
# File 'lib/corindon/dependency_injection/token/parameter_token.rb', line 9 def initialize(key:) super() @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/corindon/dependency_injection/token/parameter_token.rb', line 7 def key @key end |
Instance Method Details
#resolve(injector:) ⇒ Object
16 17 18 |
# File 'lib/corindon/dependency_injection/token/parameter_token.rb', line 16 def resolve(injector:) injector.container.parameter(key) end |