Class: Ingenico::Connect::SDK::ResponseHeader
- Inherits:
-
Object
- Object
- Ingenico::Connect::SDK::ResponseHeader
- Defined in:
- lib/ingenico/connect/sdk/response_header.rb
Overview
Represents HTTP response headers Each header is immutable has a #name and #value attribute
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
HTTP header name.
-
#value ⇒ Object
readonly
HTTP header value.
Instance Method Summary collapse
-
#initialize(name, value) ⇒ ResponseHeader
constructor
Create a new header using the name and value given as parameters.
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ ResponseHeader
Create a new header using the name and value given as parameters.
8 9 10 11 12 |
# File 'lib/ingenico/connect/sdk/response_header.rb', line 8 def initialize(name, value) raise ArgumentError.new('name is required') if name.nil? or name.strip.empty? @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
HTTP header name
15 16 17 |
# File 'lib/ingenico/connect/sdk/response_header.rb', line 15 def name @name end |
#value ⇒ Object (readonly)
HTTP header value
17 18 19 |
# File 'lib/ingenico/connect/sdk/response_header.rb', line 17 def value @value end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/ingenico/connect/sdk/response_header.rb', line 19 def to_s "#{name}:#{value}" end |