class SocketLabs::InjectionApi::Message::MergeData

Represents MergeData as a key and value pair. Example:

data1 = MergeData.new("key1", "value1")

Attributes

key[RW]

the MergeData key

value[RW]

the value of the custom header

Public Class Methods

new( key = nil, value = nil ) click to toggle source

Initializes a new instance of the CustomHeader class @param [String] key @param [String] value

# File lib/socketlabs/injectionapi/message/merge_data.rb, line 21
def initialize(
    key = nil,
    value = nil
)
  @key = key
  @value = value
end

Public Instance Methods

is_valid() click to toggle source

A quick check to ensure that the MergeData is valid. @return [Boolean]

# File lib/socketlabs/injectionapi/message/merge_data.rb, line 31
def is_valid
  valid_key = StringExtension.is_nil_or_white_space(@key)
  valid_value = StringExtension.is_nil_or_white_space(@value)
  if valid_key && valid_value
    true
  end
  false
end
to_s() click to toggle source

Represents the CustomHeader name-value pair as a String @return [String]

# File lib/socketlabs/injectionapi/message/merge_data.rb, line 42
def to_s
    "#{@name}, #{@value}"
end