Class: Foobara::CommandConnectors::ShCliConnector::InputsParser::Option::OffFlag

Inherits:
Flag
  • Object
show all
Defined in:
foobara-sh-cli-connector-1.1.4/src/sh_cli_connector/inputs_parser/option/off_flag.rb

Instance Method Summary collapse

Methods inherited from Flag

#_argument_text, applicable?, #array?, attribute_to_options, #show_default?

Instance Method Details

#_long_option_name(prefixed_name) ⇒ Object



13
14
15
# File 'src/sh_cli_connector/inputs_parser/option/off_flag.rb', line 13

def _long_option_name(prefixed_name)
  "skip-#{Util.kebab_case(prefixed_name)}"
end

#cast_value(value) ⇒ Object

rubocop:disable Naming/PredicateMethod



18
19
20
21
22
23
24
25
26
27
# File 'src/sh_cli_connector/inputs_parser/option/off_flag.rb', line 18

def cast_value(value)
  unless value == true
    # Ruby's Optparser handles --no- but not --skip- prefixes. So we are implementing it ourselves.
    # :nocov:
    raise "This shouldn't happen. Please debug this!"
    # :nocov:
  end

  false
end

#supports_short_option?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'src/sh_cli_connector/inputs_parser/option/off_flag.rb', line 9

def supports_short_option?
  false
end