Class: OptParseBuilder::SplatOperandArgument
- Includes:
- FormatsOperandName, HasValue
- Defined in:
- lib/opt_parse_builder/splat_operand_argument.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes included from HasValue
Instance Method Summary collapse
-
#initialize(key, default, help_name) ⇒ SplatOperandArgument
constructor
A new instance of SplatOperandArgument.
- #operand_notation ⇒ Object
- #shift_operand(argv) ⇒ Object
Methods included from HasValue
Methods included from FormatsOperandName
Methods inherited from Argument
#apply_option, #banner_lines, #footer_lines, #key, #optional, #required, #reset, #separator_lines, #to_a, #value, #value=
Constructor Details
#initialize(key, default, help_name) ⇒ SplatOperandArgument
Returns a new instance of SplatOperandArgument.
7 8 9 10 |
# File 'lib/opt_parse_builder/splat_operand_argument.rb', line 7 def initialize(key, default, help_name) init_value(key, default) @help_name = help_name || key end |
Instance Method Details
#operand_notation ⇒ Object
12 13 14 |
# File 'lib/opt_parse_builder/splat_operand_argument.rb', line 12 def operand_notation "[<#{format_operand_name(@help_name)}>...]" end |
#shift_operand(argv) ⇒ Object
16 17 18 19 |
# File 'lib/opt_parse_builder/splat_operand_argument.rb', line 16 def shift_operand(argv) @value = argv.dup argv.clear end |