Class: Worldline::Acquiring::SDK::Communication::RequestParam

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#nameString (readonly)

Parameter name

Returns:

  • (String)

    the current value of name



10
11
12
# File 'lib/worldline/acquiring/sdk/communication/request_param.rb', line 10

def name
  @name
end

#valueString (readonly)

Parameter value

Returns:

  • (String)

    the current value of value



10
11
12
# File 'lib/worldline/acquiring/sdk/communication/request_param.rb', line 10

def value
  @value
end

Instance Method Details

#to_sObject



23
24
25
# File 'lib/worldline/acquiring/sdk/communication/request_param.rb', line 23

def to_s
  "#{name}=#{value}"
end