Class: Metaforce::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/metaforce/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.

[View source]

55
56
57
# File 'lib/metaforce/config.rb', line 55

def initialize
  @threading = false
end

Instance Attribute Details

#api_versionObject

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

#authentication_handlerObject

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

#hostObject

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

#passwordObject

The password to use during login.


39
40
41
# File 'lib/metaforce/config.rb', line 39

def password
  @password
end

#security_tokenObject

The security token to use during login.


41
42
43
# File 'lib/metaforce/config.rb', line 41

def security_token
  @security_token
end

#threadingObject

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

#usernameObject

The username to use during login.


37
38
39
# File 'lib/metaforce/config.rb', line 37

def username
  @username
end

Instance Method Details

#endpointObject

[View source]

88
89
90
# File 'lib/metaforce/config.rb', line 88

def endpoint
  "https://#{host}/services/Soap/u/#{api_version}"
end

#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

#loggerObject

[View source]

96
97
98
# File 'lib/metaforce/config.rb', line 96

def logger
  @logger ||= ::Logger.new STDOUT
end

#metadata_wsdlObject

[View source]

84
85
86
# File 'lib/metaforce/config.rb', line 84

def 
  File.join(wsdl, 'metadata.xml')
end

#partner_wsdlObject

[View source]

80
81
82
# File 'lib/metaforce/config.rb', line 80

def partner_wsdl
  File.join(wsdl, 'partner.xml')
end

#wsdlObject

[View source]

92
93
94
# File 'lib/metaforce/config.rb', line 92

def wsdl
  File.expand_path("../../../wsdl/#{api_version}", __FILE__)
end