markety 2.1.0 → 2.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38cc31c8cd2077f0868313952b394f8c47712512
4
- data.tar.gz: 9016bdefb8cd7d9aaec957379d90004e02d02952
3
+ metadata.gz: b1347cb773faa75e338f11502d21809049000dd0
4
+ data.tar.gz: 24b107c2113c0b2584f2d640bbe470025f8817ca
5
5
  SHA512:
6
- metadata.gz: 29ab1101e22a4cfde02a7e7ff879e2ecd15cfe74426057a20b6d48bc865a1b71b275fcf39dd33d882532b477ca9056f43262bae062ee94bd726a3f9af194414e
7
- data.tar.gz: 13de0488f4d123ffa13dd63fcf8c70b3467b05a1829b2c837a4b19b99a49b6c7624b44144d0bb64e9dc30ba0b4ff3981a4c60721f1cedbe30cdf2417fbdd18eb
6
+ metadata.gz: 93d3ce0bab7a5663f01508adbab902a27529c8f92a48633aece92c9500a32f37a0914f5af7fe6b4199464ad10f973c758ed5b9b6da390a9a67133d6029a0b10b
7
+ data.tar.gz: a41153b4bb03266193dc9969db45fabdb85d362c3ce051bbd275928b582471ea12cc00212a6a571c471d95287beb0edfbe2c5f595062dde5dac91e0f572e8b5c
data/README.md CHANGED
@@ -23,11 +23,15 @@ Instantiate a new Markety client using your Marketo SOAP endpoint, User ID, and
23
23
  ```ruby
24
24
  client = Markety::Client.new(USER_ID, ENCRYPTION_KEY, END_POINT)
25
25
  # or, if using a workspace:
26
- client = Markety.::Client.new(USER_ID, ENCRYPTION_KEY, END_POINT, target_workspace: "ws_name")
26
+ client = Markety::Client.new(USER_ID, ENCRYPTION_KEY, END_POINT, target_workspace: "ws_name")
27
27
  ```
28
28
 
29
- You can get leads from Marketo by idnum or by email. Markety returns a ``GetLeadResponse`` object which contains an array of leads. Because Marketo allows for an email address to be tied to more than one lead, getting by email could
30
- potentially result in an array of leads with the same email address so you can call ``.leads`` to get all the leads in the array. Getting a lead by idnum will return a single lead, however because ``GetLeadResponse`` is an array of leads, you'll need to add ``.lead`` to get the lead from the response.
29
+ You can get leads from Marketo by idnum or by email. Markety returns a ``GetLeadResponse``
30
+ object which contains an array of leads. Because Marketo allows for an email address to be
31
+ tied to more than one lead, getting by email could potentially result in an array of leads
32
+ with the same email address so you can call ``.leads`` to get all the leads in the array.
33
+ Getting a lead by idnum will return a single lead, however because ``GetLeadResponse`` is
34
+ an array of leads, you'll need to add ``.lead`` to get the lead from the response.
31
35
  ```ruby
32
36
  # By idnum
33
37
  lead = client.get_lead_by_idnum("123456").lead # Single lead object (or nil)
@@ -45,7 +49,8 @@ lead.set_attribute("Email", "joe-schmoe@example.com")
45
49
  lead.set_attribute("Activated", true, "Boolean") # [1] see below
46
50
  ```
47
51
 
48
- Once you're ready to sync back, just tell Markety how you'd like it to sync. There are currently 3 supported methods, "EMAIL", "MARKETO_ID" and "FOREIGN_ID"
52
+ Once you're ready to sync back, just tell Markety how you'd like it to sync.
53
+ There are currently 3 supported methods, "EMAIL", "MARKETO_ID" and "FOREIGN_ID"
49
54
  ```
50
55
  # Sync the lead with Marketo
51
56
  response = client.sync_lead_record(lead, "EMAIL")
@@ -65,7 +70,8 @@ client.add_to_list('The_List_Name', lead.idnum).list_operation_status #true if s
65
70
  client.remove_from_list('The_List_Name', lead.idnum).list_operation_status #true if successful removal
66
71
  ```
67
72
 
68
- Lastly, if you would like to create a lead in Marketo, you can use the sync lead method the same way you would use the sync lead to update a lead. Just start by instantiating a Markety::Lead.
73
+ Lastly, if you would like to create a lead in Marketo, you can use the sync lead method the same way
74
+ you would use the sync lead to update a lead. Just start by instantiating a Markety::Lead.
69
75
  ```ruby
70
76
  new_lead = Markety::Lead.new
71
77
  new_lead.set_attribute("Email", "doge@suchemail.com")
@@ -80,7 +86,8 @@ _(Admin » Field Management » New Custom Field)_
80
86
  ## Options
81
87
 
82
88
  ```ruby
83
- # Turn of Savon logging - logging is helpful during development, but outputs a lot of text which you may not want in production
89
+ # Turn off Savon logging - logging is helpful during development,
90
+ # but outputs a lot of text which you may not want in production
84
91
  client = Markety::Client.new(USER_ID, ENCRYPTION_KEY, END_POINT, { log: false })
85
92
  ```
86
93
 
@@ -94,13 +101,22 @@ PRs are very welcome! Feel free to send a PR for any endpoint you might need.
94
101
  4. Push to the branch (`git push origin my-new-feature`)
95
102
  5. Create new Pull Request
96
103
 
104
+ ###Dev hint:
105
+
106
+ In `irb`, from this repo's root dir, this will load the Markety classes:
107
+
108
+ > $LOAD_PATH.unshift "./lib"
109
+ > require 'markety'
110
+
111
+
97
112
  ## To Do's
98
113
  1. More tests.
99
114
  2. Add campaign endpoints.
100
115
 
101
116
  ## Marketo Lead REST API
102
117
 
103
- Marketo released a lead REST API on June 20, 2014 so be sure to check developers.marketo.com for another lead management integration possibility.
118
+ Marketo released a lead REST API on June 20, 2014 so be sure to check developers.marketo.com
119
+ for another lead management integration possibility.
104
120
 
105
121
  ## Authors
106
122
  David Santoso and [Grant Birchmeier](https://github.com/gbirchmeier).
@@ -13,6 +13,7 @@ module Markety
13
13
  end
14
14
 
15
15
  def ==(other)
16
+ other.is_a?(Lead) &&
16
17
  @attributes==other.send(:attributes) &&
17
18
  @idnum==other.idnum &&
18
19
  @email==other.email &&
@@ -1,3 +1,3 @@
1
1
  module Markety
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
@@ -5,7 +5,6 @@ module Markety
5
5
  IDNUM = 93480938
6
6
 
7
7
 
8
-
9
8
  describe Lead do
10
9
  it "should store the idnum" do
11
10
  lead_record = Lead.new(email:EMAIL, idnum:IDNUM)
@@ -25,7 +24,13 @@ module Markety
25
24
  lead_record2.set_attribute('favourite color', 'red')
26
25
  lead_record2.set_attribute('age', '100')
27
26
 
28
- lead_record1.should == lead_record2
27
+ (lead_record1==lead_record2).should be true
28
+
29
+ lead_record2.set_attribute('age', '200')
30
+ (lead_record1==lead_record2).should be false
31
+
32
+ # issue 21
33
+ (lead_record1==123).should be false
29
34
  end
30
35
 
31
36
  it "should store when attributes are set" do
@@ -99,5 +104,6 @@ module Markety
99
104
 
100
105
  actual.should == expected
101
106
  end
107
+
102
108
  end
103
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markety
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Santoso