class Kitchen::Terraform::CommandFlag::Upgrade

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

Attributes

enabled[RW]

Public Class Methods

new(enabled:) click to toggle source

initialize prepares a new instance of the class.

@param enabled [Boolean] a toggle to enable or disable the upgrade. @return [Kitchen::Terraform::CommandFlag::Upgrade]

# File lib/kitchen/terraform/command_flag/upgrade.rb, line 26
def initialize(enabled:)
  self.enabled = enabled
end

Public Instance Methods

to_s() click to toggle source

@return [String] the upgrade flag.

# File lib/kitchen/terraform/command_flag/upgrade.rb, line 31
def to_s
  if enabled
    "-upgrade=true"
  else
    ""
  end
end