class Kitchen::Terraform::SystemAttrsInputsResolver

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

Attributes

attrs[RW]

Public Class Methods

new(attrs:) click to toggle source

initialize prepares a new instance of the class.

@param attrs [Hash] a container for attributes. @return [Kitchen::Terraform::SystemAttrsInputsResolver]

# File lib/kitchen/terraform/system_attrs_inputs_resolver.rb, line 28
def initialize(attrs:)
  self.attrs = attrs
end

Public Instance Methods

resolve(inputs:) click to toggle source

resolve stores the inputs as attributes.

@param inputs [Hash{String=>String}] the variables to be stored as inputs. @return self

# 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