Skip to content

Instantly share code, notes, and snippets.

@SahSantoshh
Created May 23, 2020 07:53
Show Gist options
  • Save SahSantoshh/38e71613ea658854a318baa0cb77f820 to your computer and use it in GitHub Desktop.
Save SahSantoshh/38e71613ea658854a318baa0cb77f820 to your computer and use it in GitHub Desktop.
# Restforce uses faye as the underlying implementation for CometD.
require 'restforce'
require 'faye'
class SalesforceSubscriber
attr_reader :client
LOG_PATH = "#{Rails.root}/log/#{Rails.env}_salesforce.log"
# Initialize a client with your username/password/oauth token/etc.
def initialize
@client = Restforce.new(username: ENV['SF_USERNAME'],
password: ENV['SF_PASSWORD'],
security_token: ENV['SF_SECURITY_TOKEN'],
client_id: ENV['SF_CLIENT_ID'],
client_secret: ENV['SF_SECRET_ID'])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment