Class: Metaforce::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#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



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

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

#log=(log) ⇒ Object



65
66
67
68
69
70
# File 'lib/metaforce/config.rb', line 65

def log=(log)
  Savon.configure do |config|
    config.log = log
  end
  HTTPI.log = log
end

#loggerObject



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

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

#metadata_wsdlObject



76
77
78
# File 'lib/metaforce/config.rb', line 76

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

#partner_wsdlObject



72
73
74
# File 'lib/metaforce/config.rb', line 72

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

#wsdlObject



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

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