Class: OptParseBuilder::SplatOperandArgument

Inherits:
Argument
  • Object
show all
Includes:
FormatsOperandName, HasValue
Defined in:
lib/opt_parse_builder/splat_operand_argument.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes included from HasValue

#key, #value

Instance Method Summary collapse

Methods included from HasValue

#init_value, #reset

Methods included from FormatsOperandName

#format_operand_name

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_notationObject



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