Class: Worldline::Acquiring::SDK::Communication::RequestParam
- Inherits:
-
Object
- Object
- Worldline::Acquiring::SDK::Communication::RequestParam
- Defined in:
- lib/worldline/acquiring/sdk/communication/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.
12 13 14 15 16 17 18 |
# File 'lib/worldline/acquiring/sdk/communication/request_param.rb', line 12 def initialize(name, value) if name.nil? || name.strip.empty? raise ArgumentError.new('name is required') end @name = name @value = value end |
Instance Attribute Details
#name ⇒ String (readonly)
Parameter name
10 11 12 |
# File 'lib/worldline/acquiring/sdk/communication/request_param.rb', line 10 def name @name end |
#value ⇒ String (readonly)
Parameter value
10 11 12 |
# File 'lib/worldline/acquiring/sdk/communication/request_param.rb', line 10 def value @value end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/worldline/acquiring/sdk/communication/request_param.rb', line 23 def to_s "#{name}=#{value}" end |