Class: Foobara::CommandConnectors::ShCliConnector::InputsParser::Option::OffFlag
- Inherits:
-
Flag
- Object
- Foobara::CommandConnectors::ShCliConnector::InputsParser::Option
- Flag
- Foobara::CommandConnectors::ShCliConnector::InputsParser::Option::OffFlag
- Defined in:
- foobara-sh-cli-connector-1.1.3/src/sh_cli_connector/inputs_parser/option/off_flag.rb
Instance Attribute Summary
Attributes inherited from Foobara::CommandConnectors::ShCliConnector::InputsParser::Option
#always_prefix_inputs, #attribute_name, #attribute_type, #default, #is_required, #prefix
Instance Method Summary collapse
- #_long_option_name(prefixed_name) ⇒ Object
-
#cast_value(value) ⇒ Object
rubocop:disable Naming/PredicateMethod.
- #supports_short_option? ⇒ Boolean
Methods inherited from Flag
#_argument_text, applicable?, #array?, attribute_to_options, #show_default?
Methods inherited from Foobara::CommandConnectors::ShCliConnector::InputsParser::Option
#_argument_text, #_non_colliding_path, #_prefixed_name, #_truncated_path, #_truncated_paths, #array?, attribute_to_options, #description, #full_path, #has_default?, #initialize, #primitive?, #required?, #show_default?, #to_args
Constructor Details
This class inherits a constructor from Foobara::CommandConnectors::ShCliConnector::InputsParser::Option
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
9 10 11 |
# File 'src/sh_cli_connector/inputs_parser/option/off_flag.rb', line 9 def supports_short_option? false end |