Class: OptParseBuilder::ConstantArgument
- Defined in:
- lib/opt_parse_builder/constant_argument.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key, value) ⇒ ConstantArgument
constructor
A new instance of ConstantArgument.
Methods inherited from Argument
#apply_option, #banner_lines, #footer_lines, #operand_notation, #optional, #required, #reset, #separator_lines, #shift_operand, #to_a, #value=
Constructor Details
#initialize(key, value) ⇒ ConstantArgument
Returns a new instance of ConstantArgument.
7 8 9 10 11 12 13 |
# File 'lib/opt_parse_builder/constant_argument.rb', line 7 def initialize(key, value) unless key raise BuildError, "default requires a key" end @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
4 5 6 |
# File 'lib/opt_parse_builder/constant_argument.rb', line 4 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/opt_parse_builder/constant_argument.rb', line 5 def value @value end |