Class: Pdi::Spoon::Options::Param

Inherits:
Arg
  • Object
show all
Defined in:
lib/pdi/spoon/options/param.rb

Overview

This class sub-classes Arg and knows how to form param key-value pair arguments.

Constant Summary collapse

EQUALS =
'='

Constants inherited from Arg

Arg::COLON, Arg::DOUBLE_QUOTE, Arg::EMPTY, Arg::HYPHEN, Arg::SPACE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Arg

#==, #hash, #to_s

Constructor Details

#initialize(key, value = '') ⇒ Param

Returns a new instance of Param.



21
22
23
24
25
# File 'lib/pdi/spoon/options/param.rb', line 21

def initialize(key, value = '')
  super(Key::PARAM, "#{key}#{EQUALS}#{value}")

  freeze
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



19
20
21
# File 'lib/pdi/spoon/options/param.rb', line 19

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



19
20
21
# File 'lib/pdi/spoon/options/param.rb', line 19

def value
  @value
end