Class: Kitchen::Terraform::CommandFlag::Var

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

Overview

Var is the class of objects which control the configuration variables.

Instance Method Summary collapse

Constructor Details

#initialize(arguments:) ⇒ Kitchen::Terraform::CommandFlag::Var

#initialize prepares a new instance of the class.

Parameters:

  • arguments (Hash{String=>String})

    the arguments.



26
27
28
# File 'lib/kitchen/terraform/command_flag/var.rb', line 26

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

Instance Method Details

#to_sString

Returns the backend configuration flag.

Returns:

  • (String)

    the backend configuration flag.



31
32
33
34
35
# File 'lib/kitchen/terraform/command_flag/var.rb', line 31

def to_s
  arguments.map do |key, value|
    "-var=\"#{key}=#{value}\""
  end.join " "
end