Class: Corindon::DependencyInjection::Token::ParameterToken

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (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

Parameters:



16
17
18
# File 'lib/corindon/dependency_injection/token/parameter_token.rb', line 16

def resolve(injector:)
  injector.container.parameter(key)
end