module Restforce::Concerns::Base
def initialize(opts = {})
:authentication_callback
:proxy_uri - Proxy URI: 'http://proxy.example.com:port' or 'http://user@pass:proxy.example.com:port'
:timeout - Faraday connection request read/open timeout. (default: nil).
Restforce::Sobjects and Restforce::Collections. (default: nil).
:mashify - Set to false to skip the conversion of Salesforce responses to
:compress - Set to true to have Salesforce compress the response (default: false).
before raising an exception (default: 3).
should attempt to reauthenticate
:authentication_retries - The number of times that client
:api_version - The String REST api version to use (default: '24.0')
authentication requests (default: 'login.salesforce.com').
:host - The String hostname to use during
:client_secret - The oauth client secret to use.
password and oauth authentication
:client_id - The oauth client id to use. Needed for both
(required if oauth authentication is used).
:instance_url - The String base url for all api requests
authentication is used).
oauth access tokens (required if oauth
:refresh_token - The String refresh token to obtain fresh
authentication is used).
calls (required unless password
:oauth_token - The String oauth access token to authenticate api
:security_token - The String security token to use (required for password authentication).
:password - The String password to use (required for password authentication).
:username - The String username to use (required for password authentication).
opts - A hash of options to be passed in (default: {}).
Public: Creates a new client instance
def initialize(opts = {}) raise ArgumentError, 'Please specify a hash of options' unless opts.is_a?(Hash) @options = Hash[Restforce.configuration.options.map { |option| [option, Restforce.configuration.send(option)] }] @options.merge! opts yield builder if block_given? end
def inspect
def inspect "#<#{self.class} @options=#{@options.inspect}>" end
def instance_url
def instance_url authenticate! unless options[:instance_url] options[:instance_url] end