Class: Ingenico::Direct::SDK::RequestParam
- Inherits:
-
Object
- Object
- Ingenico::Direct::SDK::RequestParam
- Defined in:
- lib/ingenico/direct/sdk/request_param.rb
Overview
Represents a URL request parameter. Each parameter is immutable and has a #name and #value attribute.
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
Parameter name.
-
#value ⇒ String
readonly
Parameter value.
Instance Method Summary collapse
-
#initialize(name, value) ⇒ RequestParam
constructor
A new instance of RequestParam.
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ RequestParam
Returns a new instance of RequestParam.
10 11 12 13 14 |
# File 'lib/ingenico/direct/sdk/request_param.rb', line 10 def initialize(name, value) raise ArgumentError, 'name is required' if name.nil? || name.strip.empty? @name = name @value = value end |
Instance Attribute Details
#name ⇒ String (readonly)
Parameter name
8 9 10 |
# File 'lib/ingenico/direct/sdk/request_param.rb', line 8 def name @name end |
#value ⇒ String (readonly)
Parameter value
8 9 10 |
# File 'lib/ingenico/direct/sdk/request_param.rb', line 8 def value @value end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/ingenico/direct/sdk/request_param.rb', line 19 def to_s "#{name}=#{value}" end |