Class: OptParseBuilder::ConstantArgument

Inherits:
Argument
  • Object
show all
Defined in:
lib/opt_parse_builder/constant_argument.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



4
5
6
# File 'lib/opt_parse_builder/constant_argument.rb', line 4

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



5
6
7
# File 'lib/opt_parse_builder/constant_argument.rb', line 5

def value
  @value
end