Class: Metaforce::Configuration
- Inherits:
-
Object
- Object
- Metaforce::Configuration
- Defined in:
- lib/metaforce/config.rb
Instance Attribute Summary collapse
-
#api_version ⇒ Object
The Salesforce API version to use.
-
#authentication_handler ⇒ Object
A block that gets called when the session becomes invalid and the client needs to reauthenticate.
-
#host ⇒ Object
Set this to true if you’re authenticating with a Sandbox instance.
-
#password ⇒ Object
The password to use during login.
-
#security_token ⇒ Object
The security token to use during login.
-
#threading ⇒ Object
Enables or disables threading when polling for job status.
-
#username ⇒ Object
The username to use during login.
Instance Method Summary collapse
- #endpoint ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #log=(log) ⇒ Object
- #logger ⇒ Object
- #metadata_wsdl ⇒ Object
- #partner_wsdl ⇒ Object
- #wsdl ⇒ Object
Constructor Details
permalink #initialize ⇒ Configuration
Returns a new instance of Configuration.
55 56 57 |
# File 'lib/metaforce/config.rb', line 55 def initialize @threading = false end |
Instance Attribute Details
permalink #api_version ⇒ Object
The Salesforce API version to use. Defaults to 23.0
35 36 37 |
# File 'lib/metaforce/config.rb', line 35 def api_version @api_version end |
permalink #authentication_handler ⇒ Object
A block that gets called when the session becomes invalid and the client needs to reauthenticate. Passes in the client and the client options. The block should set the options to a hash containing a valid session_id and service urls.
49 50 51 |
# File 'lib/metaforce/config.rb', line 49 def authentication_handler @authentication_handler end |
permalink #host ⇒ Object
Set this to true if you’re authenticating with a Sandbox instance. Defaults to false.
44 45 46 |
# File 'lib/metaforce/config.rb', line 44 def host @host end |
permalink #password ⇒ Object
The password to use during login.
39 40 41 |
# File 'lib/metaforce/config.rb', line 39 def password @password end |
permalink #security_token ⇒ Object
The security token to use during login.
41 42 43 |
# File 'lib/metaforce/config.rb', line 41 def security_token @security_token end |
permalink #threading ⇒ Object
Enables or disables threading when polling for job status. If disabled, calling .perform on a job will block until completion and all callbacks have run. (default: true).
53 54 55 |
# File 'lib/metaforce/config.rb', line 53 def threading @threading end |
permalink #username ⇒ Object
The username to use during login.
37 38 39 |
# File 'lib/metaforce/config.rb', line 37 def username @username end |
Instance Method Details
permalink #endpoint ⇒ Object
[View source]
88 89 90 |
# File 'lib/metaforce/config.rb', line 88 def endpoint "https://#{host}/services/Soap/u/#{api_version}" end |
permalink #log=(log) ⇒ Object
[View source]
73 74 75 76 77 78 |
# File 'lib/metaforce/config.rb', line 73 def log=(log) Savon.configure do |config| config.log = log end HTTPI.log = log end |
permalink #logger ⇒ Object
[View source]
96 97 98 |
# File 'lib/metaforce/config.rb', line 96 def logger @logger ||= ::Logger.new STDOUT end |
permalink #metadata_wsdl ⇒ Object
[View source]
84 85 86 |
# File 'lib/metaforce/config.rb', line 84 def File.join(wsdl, 'metadata.xml') end |
permalink #partner_wsdl ⇒ Object
[View source]
80 81 82 |
# File 'lib/metaforce/config.rb', line 80 def partner_wsdl File.join(wsdl, 'partner.xml') end |
permalink #wsdl ⇒ Object
[View source]
92 93 94 |
# File 'lib/metaforce/config.rb', line 92 def wsdl File.("../../../wsdl/#{api_version}", __FILE__) end |