Class: NVX::SDS::APIParam

Inherits:
Object
  • Object
show all
Defined in:
lib/nvx/sds/apiparam.rb

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ APIParam

The initialize method stores the key and value of the parameter to be passed.



12
13
14
15
# File 'lib/nvx/sds/apiparam.rb', line 12

def initialize(key, value)
    @key = key
    @value = value
end

Instance Method Details

#keyObject

Returns the key.



18
19
20
# File 'lib/nvx/sds/apiparam.rb', line 18

def key
    @key
end

#to_sObject

Overload to return a CGI::escape version of the key=value pair.



28
29
30
# File 'lib/nvx/sds/apiparam.rb', line 28

def to_s  
     CGI::escape(@key.to_s) + "=" +  CGI::escape(@value.to_s);
end

#valueObject

Returns the value.



23
24
25
# File 'lib/nvx/sds/apiparam.rb', line 23

def value
    @value
end