class Luban::CLI::Switch

Public Instance Methods

default_str() click to toggle source
# File lib/luban/cli/base/switch.rb, line 4
def default_str
  @default_str ||= build_default_str
end

Protected Instance Methods

build_default_str() click to toggle source
# File lib/luban/cli/base/switch.rb, line 18
def build_default_str
  @config[:default] ? "--#{long_opt_name}" : ""
end
build_long_option() click to toggle source
# File lib/luban/cli/base/switch.rb, line 22
def build_long_option
  "--#{long_opt_name}"
end
init_config() click to toggle source
Calls superclass method Luban::CLI::Argument#init_config
# File lib/luban/cli/base/switch.rb, line 10
def init_config
  super
  # Ensure value type to be boolean
  @config[:type] = :bool
  # Ensure single value instead of multiple
  @config[:multiple] = false
end