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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lead_create.rb +18 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65dc018942188ab6cdc03299228970d40c814c1f
4
- data.tar.gz: b4373e345c5cbee3ef8deb7c5dba31dbd6110d1a
3
+ metadata.gz: 46ca146fffab21c35a3a0adeb970fd8eac71da50
4
+ data.tar.gz: 9c68cb21c49ff7335f0cec351696b2a2c3c79860
5
5
  SHA512:
6
- metadata.gz: ed65e4b755afd8c120890b28563121636f93236de8fd4257c6dc469da0cf3cc3c62bc68790620f62eaeadaa9a4b4aaf3e3824f3262375d92ba987deab4568a4f
7
- data.tar.gz: 2c2262b0eb25406c17d5ae976d9b8b886dce96c812b22f533cc2e0f06ed2291998150644c351a3e2c62cbba829046c229b5ef31e9ab278592590a22424c8a036
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
- lead = take_lead_object
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
- lead = take_lead_object
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
- return client.materialize('Lead')
33
+ client.materialize('Lead')
20
34
  end
21
35
 
22
36
  def load_new_lead(contato)
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.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matheus Lucena