class Kitchen::Terraform::CommandFlag::Color

Color is the class of objects which control coloured output.

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 color. @return [Kitchen::Terraform::CommandFlag::Color]

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

Public Instance Methods

to_s() click to toggle source

@return [String] the color flag.

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