Method: Ark::CLI::Option#toggle

Defined in:
lib/ark/cli/option.rb

#toggleObject

Toggle this option to the true state and increment the toggle count. Only valid for options which expect no argument (flags). Attempting to toggle a option with expected arguments will raise an error.



59
60
61
62
63
64
65
66
# File 'lib/ark/cli/option.rb', line 59

def toggle()
  if self.flag?
    @count += 1
    @flag = true
  else
    raise StandardError, "Tried to toggle an option which expects an argument"
  end
end