Class: Bulkforce::Configuration
- Inherits:
-
Object
- Object
- Bulkforce::Configuration
- Defined in:
- lib/bulkforce/configuration.rb
Instance Attribute Summary collapse
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#host ⇒ Object
Returns the value of attribute host.
-
#instance ⇒ Object
Returns the value of attribute instance.
-
#password ⇒ Object
Returns the value of attribute password.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
-
#security_token ⇒ Object
Returns the value of attribute security_token.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bulkforce/configuration.rb', line 14 def initialize @api_version = ENV["SALESFORCE_API_VERSION"] || "33.0" @username = ENV["SALESFORCE_USERNAME"] @password = ENV["SALESFORCE_PASSWORD"] @security_token = ENV["SALESFORCE_SECURITY_TOKEN"] @host = ENV["SALESFORCE_HOST"] || "login.salesforce.com" @session_id = ENV["SALESFORCE_SESSION_ID"] @instance = ENV["SALESFORCE_INSTANCE"] @client_id = ENV["SALESFORCE_CLIENT_ID"] @client_secret = ENV["SALESFORCE_CLIENT_SECRET"] @refresh_token = ENV["SALESFORCE_REFRESH_TOKEN"] end |
Instance Attribute Details
#api_version ⇒ Object
Returns the value of attribute api_version.
3 4 5 |
# File 'lib/bulkforce/configuration.rb', line 3 def api_version @api_version end |
#client_id ⇒ Object
Returns the value of attribute client_id.
10 11 12 |
# File 'lib/bulkforce/configuration.rb', line 10 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
11 12 13 |
# File 'lib/bulkforce/configuration.rb', line 11 def client_secret @client_secret end |
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/bulkforce/configuration.rb', line 7 def host @host end |
#instance ⇒ Object
Returns the value of attribute instance.
9 10 11 |
# File 'lib/bulkforce/configuration.rb', line 9 def instance @instance end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/bulkforce/configuration.rb', line 5 def password @password end |
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
12 13 14 |
# File 'lib/bulkforce/configuration.rb', line 12 def refresh_token @refresh_token end |
#security_token ⇒ Object
Returns the value of attribute security_token.
6 7 8 |
# File 'lib/bulkforce/configuration.rb', line 6 def security_token @security_token end |
#session_id ⇒ Object
Returns the value of attribute session_id.
8 9 10 |
# File 'lib/bulkforce/configuration.rb', line 8 def session_id @session_id end |
#username ⇒ Object
Returns the value of attribute username.
4 5 6 |
# File 'lib/bulkforce/configuration.rb', line 4 def username @username end |
Instance Method Details
#to_h ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/bulkforce/configuration.rb', line 27 def to_h { api_version: api_version, username: username, password: password, security_token: security_token, host: host, session_id: session_id, instance: instance, client_id: client_id, client_secret: client_secret, refresh_token: refresh_token, }.reject { |_, v| v.nil? }.to_h end |