lead_create 0.0.11 → 0.0.12
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 +17 -24
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08f17718741df5f1cf628b74d96e4296d5c4a908
|
4
|
+
data.tar.gz: 6c0d3c754aec5a1e086c82a52c58a1eaaa443b1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b65585ab233e4e711afc84a401ee492b8c16d49018b2598f31ffcb3868506c035f4b2ea04f1fad63f803496afd6c0a753192e61110a60c2c57b2e38ed755c83
|
7
|
+
data.tar.gz: b3fbe8f6472003a1fcfe7123f7c0262d40b8b07296aee1482c9739d26d6c38c1e2e76fb2c5b717e42ef7a558ada0ff275e38123dbbeff5a3ee1c0d9fa3aef6cd
|
data/lib/lead_create.rb
CHANGED
@@ -1,40 +1,33 @@
|
|
1
1
|
class LeadCreate
|
2
2
|
def self.create(contato)
|
3
|
-
|
4
|
-
|
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
|
17
|
-
@lead = lead.new
|
3
|
+
connect
|
4
|
+
load_new_lead(contato)
|
18
5
|
if @lead.save
|
19
6
|
contato.name + ' successfully added'
|
20
7
|
end
|
21
8
|
end
|
22
9
|
|
23
10
|
def self.list_leads
|
24
|
-
|
25
|
-
|
26
|
-
lead = client.materialize('Lead')
|
11
|
+
connect
|
12
|
+
lead = take_lead
|
27
13
|
lead.all
|
28
14
|
end
|
29
15
|
|
30
|
-
|
31
|
-
|
32
|
-
client
|
33
|
-
client.
|
16
|
+
private
|
17
|
+
def self.connect
|
18
|
+
@client = Databasedotcom::Client.new('config/databasedotcom.yml')
|
19
|
+
@client.authenticate :username => 'matheuslucena@gmail.com', :password => 'slayer666DT0tilUUmpLca7X5kWKGCKDf'
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.take_lead
|
23
|
+
connect
|
24
|
+
@client.materialize('Lead')
|
34
25
|
end
|
35
26
|
|
36
|
-
def load_new_lead(contato)
|
37
|
-
|
27
|
+
def self.load_new_lead(contato)
|
28
|
+
@lead = @client.materialize('Lead')
|
29
|
+
@lead = @lead.new
|
30
|
+
user = @client.materialize('User')
|
38
31
|
@lead.OwnerId = user.first.Id
|
39
32
|
@lead.FirstName = contato.name
|
40
33
|
@lead.LastName = contato.last_name
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lead_create
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matheus Lucena
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '3.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '3.3'
|
41
41
|
description: A gem to create a lead in the salesforce
|
42
42
|
email: matheuslucena@gmail.com
|
43
43
|
executables: []
|