Class: SocketLabs::InjectionApi::Core::Serialization::CustomHeaderJson
- Inherits:
-
Object
- Object
- SocketLabs::InjectionApi::Core::Serialization::CustomHeaderJson
- Defined in:
- lib/socketlabs/injectionapi/core/serialization/custom_header_json.rb
Overview
Represents a custom header as a name and value pair. To be serialized into JSON string before sending to the Injection Api.
Instance Attribute Summary collapse
-
#name ⇒ Object
name of the custom header.
-
#value ⇒ Object
value of the custom header.
Instance Method Summary collapse
-
#initialize(name = nil, value = nil) ⇒ CustomHeaderJson
constructor
Initializes a new instance of the CustomHeaderJson class.
-
#to_hash ⇒ hash
build json hash for CustomHeaderJson.
Constructor Details
#initialize(name = nil, value = nil) ⇒ CustomHeaderJson
Initializes a new instance of the CustomHeaderJson class
18 19 20 21 22 23 24 |
# File 'lib/socketlabs/injectionapi/core/serialization/custom_header_json.rb', line 18 def initialize( name = nil, value = nil ) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object
name of the custom header.
11 12 13 |
# File 'lib/socketlabs/injectionapi/core/serialization/custom_header_json.rb', line 11 def name @name end |
#value ⇒ Object
value of the custom header.
13 14 15 |
# File 'lib/socketlabs/injectionapi/core/serialization/custom_header_json.rb', line 13 def value @value end |
Instance Method Details
#to_hash ⇒ hash
build json hash for CustomHeaderJson
28 29 30 31 32 33 |
# File 'lib/socketlabs/injectionapi/core/serialization/custom_header_json.rb', line 28 def to_hash { :name => @name, :value => @value } end |