Module: Leadcreator
- Defined in:
- lib/leadcreator.rb,
lib/leadcreator/version.rb
Constant Summary collapse
- VERSION =
"0.0.2"
Class Method Summary collapse
- .create(name, last_name, email, company, job_title, phone, website) ⇒ Object
- .initialize(instance_url, client_id, client_secret, oauth_token) ⇒ Object
Class Method Details
.create(name, last_name, email, company, job_title, phone, website) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/leadcreator.rb', line 15 def self.create(name, last_name, email, company, job_title, phone, website) puts "1 = " + name puts "2 = " + last_name puts "3 = " + email puts "4 = " + company puts "5 = " + job_title puts "6 = " + phone puts "7 = " + website puts " === Calling Restforce === " attributes = { FirstName: name, LastName: last_name, Email: email, Company: company, Title: job_title, Phone: phone, Website: website } @client.create!('Lead', attributes) end |
.initialize(instance_url, client_id, client_secret, oauth_token) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/leadcreator.rb', line 6 def self.initialize(instance_url, client_id, client_secret, oauth_token) credential = {:instance_url => instance_url, :client_id => client_id, :client_secret => client_secret, :oauth_token => oauth_token } @client = Restforce.new(credential) end |