module Leadcreator

Constants

VERSION

Public Class Methods

create(name, last_name, email, company, job_title, phone, website) click to toggle source
# 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) click to toggle source
# 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