Class: Markety::LeadKey

Inherits:
Object
  • Object
show all
Defined in:
lib/markety/lead_key.rb

Overview

Encapsulates a key used to look up or describe a specific marketo lead. Markety users should not use this class directly.

Instance Method Summary collapse

Constructor Details

#initialize(key_type, key_value) ⇒ LeadKey

  • key_type - value of LeadKeyType enum; the type of key to use see LeadKeyType

  • key_value - a string value for the given type



7
8
9
10
# File 'lib/markety/lead_key.rb', line 7

def initialize(key_type, key_value)
  @key_type = key_type
  @key_value = key_value
end

Instance Method Details

#key_typeObject

get the key type (a LeadKeyType enum value)



13
14
15
# File 'lib/markety/lead_key.rb', line 13

def key_type
  @key_type
end

#key_valueObject

get the key value



18
19
20
# File 'lib/markety/lead_key.rb', line 18

def key_value
  @key_value
end

#to_hashObject

create a hash from this instance, for sending this object to marketo using savon



23
24
25
26
27
28
# File 'lib/markety/lead_key.rb', line 23

def to_hash
  {
    "keyType" => @key_type,
    "keyValue" => @key_value
  }
end