Sha256: 2268b8654823e7fdda5553318059bd9e53f1f27aebaf7720500171f8124c4914

Contents?: true

Size: 970 Bytes

Versions: 8

Compression:

Stored size: 970 Bytes

Contents

module SocketLabs
  module InjectionApi
    module Core
      module Serialization

        # Represents a merge field as a field and value pair.
        # To be serialized into JSON string before sending to the Injection Api.
        class MergeFieldJson

          # The field of your merge field.
          attr_accessor :field
          # The merge field value.
          attr_accessor :value

          # Initializes a new instance of the MergeFieldJson class
          # @param [String] field
          # @param [String] value
          def initialize(
            field = nil,
            value = nil
          )
            @field = field
            @value = value
          end

          # build json hash for MergeFieldJson
          # @return [hash]
          def to_hash
            {
              :field => @field,
              :value => @value
            }
          end

        end

      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
socketlabs-injectionapi-1.4.4 lib/socketlabs/injectionapi/core/serialization/merge_field_json.rb
socketlabs-injectionapi-1.4.3 lib/socketlabs/injectionapi/core/serialization/merge_field_json.rb
socketlabs-injectionapi-1.4.2 lib/socketlabs/injectionapi/core/serialization/merge_field_json.rb
socketlabs-injectionapi-1.4.0 lib/socketlabs/injectionapi/core/serialization/merge_field_json.rb
socketlabs-injectionapi-1.2.1 lib/socketlabs/injectionapi/core/serialization/merge_field_json.rb
socketlabs-injectionapi-1.1.0 lib/socketlabs/injectionapi/core/serialization/merge_field_json.rb
socketlabs-injectionapi-1.0.1 lib/socketlabs/injectionapi/core/serialization/merge_field_json.rb
socketlabs-injectionapi-0.0.1.pre.Dev lib/socketlabs/injectionapi/core/serialization/merge_field_json.rb