Skip to content

Instantly share code, notes, and snippets.

@robins35
Created April 14, 2015 20:14
Show Gist options
  • Save robins35/216e8f14a3b3fb0146fb to your computer and use it in GitHub Desktop.
Save robins35/216e8f14a3b3fb0146fb to your computer and use it in GitHub Desktop.
module SFDC_Models
module Connection
SF_CONFIG = YAML.load_file('config/databasedotcom.yml') rescue nil
def self.client
@client = Databasedotcom::Client.new("config/databasedotcom.yml")
@client.authenticate username: SF_CONFIG['username'], password: SF_CONFIG['password']
@client.materialize("Lead")
@client.materialize("Account")
@client.materialize("Contact")
@client
end
end
def self.add_lead(first_name, last_name, email, phone, lead_src, demo_signup_flag)
if SFDC_Models::Connection.instance_variable_get("@client").nil?
puts "\n"*10
puts "CALLING CLIENT!"
SFDC_Models::Connection.client
end
# BLAH BLAH
end
class << self
handle_asynchronously :add_lead
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment