Sha256: a2bb299fd1bd8899e872f69586c408bd143a60cca7ba14b4fe3add492c1360f6
Contents?: true
Size: 1008 Bytes
Versions: 1
Compression:
Stored size: 1008 Bytes
Contents
module Salesforce module Rails module API module Client module ClassMethods def client unless @client config = YAML.load(ERB.new(File.new(File.join(::Rails.root, 'config', 'salesforce.yml')).read).result) config = config.has_key?(::Rails.env) ? config[::Rails.env] : config username = config["username"] password = config["password"] token = config["token"] instance_url = config["instance_url"] @client = Databasedotcom::Client.new(config) username && password ? @client.authenticate(:username => username, :password => password) : @client.authenticate(:token => token, :instance_url => instance_url) end @client end def client=(client) @client = client end end def self.included(base) base.send(:extend, ClassMethods) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
salesforce-rails-1.0.1 | lib/salesforce/rails/api/client.rb |