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