markety 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/markety/client.rb +3 -3
- data/lib/markety/lead_record.rb +10 -2
- data/lib/markety/version.rb +1 -1
- metadata +5 -13
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 7143edcb550e8117d5de02824b3496933a7be193
|
|
4
|
+
data.tar.gz: 1c1aa3a2d062027eeb95400f4330cb85056737bb
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ca796e3496d106f2b398f88b8320e46c4a64d64832617a46b8a5369b00d3c63907eabd6836012fa2be682d69c5db34aa8752a0a3116aa9cb18a673c028e05c0c
|
|
7
|
+
data.tar.gz: 526c032a37bfda0883456b2c17ab57686eb398a8d35c09b6831f7e482b3e7bf7473d9aff1ab637811a649cd4e7ba1369a3ca00e6f6fed4a944fa5b808d001ade
|
data/lib/markety/client.rb
CHANGED
|
@@ -46,7 +46,7 @@ module Markety
|
|
|
46
46
|
begin
|
|
47
47
|
attributes = []
|
|
48
48
|
lead_record.each_attribute_pair do |name, value|
|
|
49
|
-
attributes << {:attr_name => name, :
|
|
49
|
+
attributes << {:attr_name => name, :attr_value => value, :attr_type => lead_record.get_attribute_type(name) }
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
response = send_request(:sync_lead, {
|
|
@@ -72,7 +72,7 @@ module Markety
|
|
|
72
72
|
begin
|
|
73
73
|
attributes = []
|
|
74
74
|
lead_record.each_attribute_pair do |name, value|
|
|
75
|
-
attributes << {:attr_name => name, :
|
|
75
|
+
attributes << {:attr_name => name, :attr_value => value}
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
attributes << {:attr_name => 'Id', :attr_type => 'string', :attr_value => idnum.to_s}
|
|
@@ -144,4 +144,4 @@ module Markety
|
|
|
144
144
|
@client.call(namespace, :message => message, :soap_header => header)
|
|
145
145
|
end
|
|
146
146
|
end
|
|
147
|
-
end
|
|
147
|
+
end
|
data/lib/markety/lead_record.rb
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
module Markety
|
|
2
2
|
# Represents a record of the data known about a lead within marketo
|
|
3
3
|
class LeadRecord
|
|
4
|
+
attr_reader :types
|
|
5
|
+
|
|
4
6
|
def initialize(email, idnum = nil)
|
|
5
7
|
@idnum = idnum
|
|
6
8
|
@attributes = {}
|
|
9
|
+
@types = {}
|
|
7
10
|
set_attribute('Email', email)
|
|
8
11
|
end
|
|
9
12
|
|
|
@@ -11,7 +14,7 @@ module Markety
|
|
|
11
14
|
def self.from_hash(savon_hash)
|
|
12
15
|
lead_record = LeadRecord.new(savon_hash[:email], savon_hash[:id].to_i)
|
|
13
16
|
savon_hash[:lead_attribute_list][:attribute].each do |attribute|
|
|
14
|
-
lead_record.set_attribute(attribute[:attr_name], attribute[:attr_value])
|
|
17
|
+
lead_record.set_attribute(attribute[:attr_name], attribute[:attr_value], attribute[:attr_type])
|
|
15
18
|
end
|
|
16
19
|
lead_record
|
|
17
20
|
end
|
|
@@ -31,8 +34,9 @@ module Markety
|
|
|
31
34
|
end
|
|
32
35
|
|
|
33
36
|
# update the value of the named attribute
|
|
34
|
-
def set_attribute(name, value)
|
|
37
|
+
def set_attribute(name, value, type = "string")
|
|
35
38
|
@attributes[name] = value
|
|
39
|
+
@types[name] = type
|
|
36
40
|
end
|
|
37
41
|
|
|
38
42
|
# get the value for the named attribute
|
|
@@ -40,6 +44,10 @@ module Markety
|
|
|
40
44
|
@attributes[name]
|
|
41
45
|
end
|
|
42
46
|
|
|
47
|
+
def get_attribute_type(name)
|
|
48
|
+
@types[name]
|
|
49
|
+
end
|
|
50
|
+
|
|
43
51
|
# will yield pairs of |attribute_name, attribute_value|
|
|
44
52
|
def each_attribute_pair(&block)
|
|
45
53
|
@attributes.each_pair do |name, value|
|
data/lib/markety/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: markety
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 1.3.3
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- David Santoso
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2014-01-29 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: savon
|
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
none: false
|
|
18
16
|
requirements:
|
|
19
17
|
- - '='
|
|
20
18
|
- !ruby/object:Gem::Version
|
|
@@ -22,7 +20,6 @@ dependencies:
|
|
|
22
20
|
type: :runtime
|
|
23
21
|
prerelease: false
|
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
-
none: false
|
|
26
23
|
requirements:
|
|
27
24
|
- - '='
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
@@ -30,7 +27,6 @@ dependencies:
|
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
|
31
28
|
name: wasabi
|
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
none: false
|
|
34
30
|
requirements:
|
|
35
31
|
- - '='
|
|
36
32
|
- !ruby/object:Gem::Version
|
|
@@ -38,7 +34,6 @@ dependencies:
|
|
|
38
34
|
type: :runtime
|
|
39
35
|
prerelease: false
|
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
-
none: false
|
|
42
37
|
requirements:
|
|
43
38
|
- - '='
|
|
44
39
|
- !ruby/object:Gem::Version
|
|
@@ -46,7 +41,6 @@ dependencies:
|
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
|
47
42
|
name: rspec
|
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
|
49
|
-
none: false
|
|
50
44
|
requirements:
|
|
51
45
|
- - ! '>='
|
|
52
46
|
- !ruby/object:Gem::Version
|
|
@@ -54,7 +48,6 @@ dependencies:
|
|
|
54
48
|
type: :development
|
|
55
49
|
prerelease: false
|
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
-
none: false
|
|
58
51
|
requirements:
|
|
59
52
|
- - ! '>='
|
|
60
53
|
- !ruby/object:Gem::Version
|
|
@@ -76,26 +69,25 @@ files:
|
|
|
76
69
|
- bin/markety
|
|
77
70
|
homepage: https://github.com/davidsantoso/markety
|
|
78
71
|
licenses: []
|
|
72
|
+
metadata: {}
|
|
79
73
|
post_install_message:
|
|
80
74
|
rdoc_options: []
|
|
81
75
|
require_paths:
|
|
82
76
|
- lib
|
|
83
77
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
|
-
none: false
|
|
85
78
|
requirements:
|
|
86
79
|
- - ! '>='
|
|
87
80
|
- !ruby/object:Gem::Version
|
|
88
81
|
version: 1.9.3
|
|
89
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
|
-
none: false
|
|
91
83
|
requirements:
|
|
92
84
|
- - ! '>='
|
|
93
85
|
- !ruby/object:Gem::Version
|
|
94
86
|
version: '0'
|
|
95
87
|
requirements: []
|
|
96
88
|
rubyforge_project:
|
|
97
|
-
rubygems_version: 1.
|
|
89
|
+
rubygems_version: 2.1.4
|
|
98
90
|
signing_key:
|
|
99
|
-
specification_version:
|
|
91
|
+
specification_version: 4
|
|
100
92
|
summary: Marketo SOAP API integration
|
|
101
93
|
test_files: []
|