lead_create 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lead_create.rb +18 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46ca146fffab21c35a3a0adeb970fd8eac71da50
|
4
|
+
data.tar.gz: 9c68cb21c49ff7335f0cec351696b2a2c3c79860
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90dfce2473f4175caf1effef90e60211ad9eadc944f76ef3f4edf19e54ea59a46daf0d65650e6fb509fc74c4ee21af2bd47e9276c3e05d8832eea9caddf88a64
|
7
|
+
data.tar.gz: e262116140f4ec3c371a857c3bf743cad1222e227ac8df0bee9424119e7f3fdb15ea61c26849a89d3ef9df5b34f106da34a700cc89d641319f529adf776f88f2
|
data/lib/lead_create.rb
CHANGED
@@ -1,22 +1,36 @@
|
|
1
1
|
class LeadCreate
|
2
2
|
def self.create(contato)
|
3
|
-
|
3
|
+
client = Databasedotcom::Client.new('config/databasedotcom.yml')
|
4
|
+
client.authenticate :username => 'matheuslucena@gmail.com', :password => 'slayer666DT0tilUUmpLca7X5kWKGCKDf'
|
5
|
+
@lead = client.materialize('Lead')
|
6
|
+
user = client.materialize('User')
|
7
|
+
@lead.OwnerId = user.first.Id
|
8
|
+
@lead.FirstName = contato.name
|
9
|
+
@lead.LastName = contato.last_name
|
10
|
+
@lead.Email = contato.email
|
11
|
+
@lead.Company = contato.company
|
12
|
+
@lead.Title = contato.job_title
|
13
|
+
@lead.Phone = contato.phone
|
14
|
+
@lead.Website = contato.website
|
15
|
+
@lead.IsConverted = false
|
16
|
+
@lead.IsUnreadByOwner = true
|
4
17
|
@lead = lead.new
|
5
|
-
@lead = load_new_lead(contato)
|
6
18
|
if @lead.save
|
7
19
|
contato.name + ' successfully added'
|
8
20
|
end
|
9
21
|
end
|
10
22
|
|
11
23
|
def self.list_leads
|
12
|
-
|
24
|
+
client = Databasedotcom::Client.new('config/databasedotcom.yml')
|
25
|
+
client.authenticate :username => 'matheuslucena@gmail.com', :password => 'slayer666DT0tilUUmpLca7X5kWKGCKDf'
|
26
|
+
lead = client.materialize('Lead')
|
13
27
|
lead.all
|
14
28
|
end
|
15
29
|
|
16
30
|
def take_lead_object
|
17
31
|
client = Databasedotcom::Client.new('config/databasedotcom.yml')
|
18
32
|
client.authenticate :username => 'matheuslucena@gmail.com', :password => 'slayer666DT0tilUUmpLca7X5kWKGCKDf'
|
19
|
-
|
33
|
+
client.materialize('Lead')
|
20
34
|
end
|
21
35
|
|
22
36
|
def load_new_lead(contato)
|