Class: Kitchen::Terraform::SystemAttrsInputsResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/terraform/system_attrs_inputs_resolver.rb

Overview

SystemAttrsInputsResolver is the class of objects which resolve for systems the attributes derived from Terraform variables.

Instance Method Summary collapse

Constructor Details

#initialize(attrs:) ⇒ Kitchen::Terraform::SystemAttrsInputsResolver

#initialize prepares a new instance of the class.

Parameters:

  • attrs (Hash)

    a container for attributes.



28
29
30
# File 'lib/kitchen/terraform/system_attrs_inputs_resolver.rb', line 28

def initialize(attrs:)
  self.attrs = attrs
end

Instance Method Details

#resolve(inputs:) ⇒ Object

#resolve stores the inputs as attributes.

Parameters:

  • inputs (Hash{String=>String})

    the variables to be stored as inputs.

Returns:

  • self



36
37
38
39
40
41
42
# File 'lib/kitchen/terraform/system_attrs_inputs_resolver.rb', line 36

def resolve(inputs:)
  inputs.each_pair do |input_name, input_value|
    attrs.store "input_#{input_name}", input_value
  end

  self
end