Class: OnlinePayments::SDK::RequestParam
- Inherits:
-
Object
- Object
- OnlinePayments::SDK::RequestParam
- Defined in:
- lib/onlinepayments/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/onlinepayments/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/onlinepayments/sdk/request_param.rb', line 8 def name @name end |
#value ⇒ String (readonly)
Parameter value
8 9 10 |
# File 'lib/onlinepayments/sdk/request_param.rb', line 8 def value @value end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/onlinepayments/sdk/request_param.rb', line 19 def to_s "#{name}=#{value}" end |