Class: Kitchen::Terraform::CommandFlag::Upgrade

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

Overview

Upgrade is the class of objects which control the upgrade of existing modules and plugins.

Instance Method Summary collapse

Constructor Details

#initialize(enabled:) ⇒ Kitchen::Terraform::CommandFlag::Upgrade

#initialize prepares a new instance of the class.

Parameters:

  • enabled (Boolean)

    a toggle to enable or disable the upgrade.



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

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

Instance Method Details

#to_sString

Returns the upgrade flag.

Returns:

  • (String)

    the upgrade flag.



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

def to_s
  if enabled
    "-upgrade=true"
  else
    ""
  end
end