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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lead_create.rb +17 -24
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46ca146fffab21c35a3a0adeb970fd8eac71da50
4
- data.tar.gz: 9c68cb21c49ff7335f0cec351696b2a2c3c79860
3
+ metadata.gz: 08f17718741df5f1cf628b74d96e4296d5c4a908
4
+ data.tar.gz: 6c0d3c754aec5a1e086c82a52c58a1eaaa443b1d
5
5
  SHA512:
6
- metadata.gz: 90dfce2473f4175caf1effef90e60211ad9eadc944f76ef3f4edf19e54ea59a46daf0d65650e6fb509fc74c4ee21af2bd47e9276c3e05d8832eea9caddf88a64
7
- data.tar.gz: e262116140f4ec3c371a857c3bf743cad1222e227ac8df0bee9424119e7f3fdb15ea61c26849a89d3ef9df5b34f106da34a700cc89d641319f529adf776f88f2
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
- 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
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
- client = Databasedotcom::Client.new('config/databasedotcom.yml')
25
- client.authenticate :username => 'matheuslucena@gmail.com', :password => 'slayer666DT0tilUUmpLca7X5kWKGCKDf'
26
- lead = client.materialize('Lead')
11
+ connect
12
+ lead = take_lead
27
13
  lead.all
28
14
  end
29
15
 
30
- def take_lead_object
31
- client = Databasedotcom::Client.new('config/databasedotcom.yml')
32
- client.authenticate :username => 'matheuslucena@gmail.com', :password => 'slayer666DT0tilUUmpLca7X5kWKGCKDf'
33
- client.materialize('Lead')
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
- user = client.materialize('User')
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.11
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: '0'
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: '0'
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: []