Class: Bulkforce::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/bulkforce/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_versionObject

Returns the value of attribute api_version.



3
4
5
# File 'lib/bulkforce/configuration.rb', line 3

def api_version
  @api_version
end

#client_idObject

Returns the value of attribute client_id.



10
11
12
# File 'lib/bulkforce/configuration.rb', line 10

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



11
12
13
# File 'lib/bulkforce/configuration.rb', line 11

def client_secret
  @client_secret
end

#hostObject

Returns the value of attribute host.



7
8
9
# File 'lib/bulkforce/configuration.rb', line 7

def host
  @host
end

#instanceObject

Returns the value of attribute instance.



9
10
11
# File 'lib/bulkforce/configuration.rb', line 9

def instance
  @instance
end

#passwordObject

Returns the value of attribute password.



5
6
7
# File 'lib/bulkforce/configuration.rb', line 5

def password
  @password
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



12
13
14
# File 'lib/bulkforce/configuration.rb', line 12

def refresh_token
  @refresh_token
end

#security_tokenObject

Returns the value of attribute security_token.



6
7
8
# File 'lib/bulkforce/configuration.rb', line 6

def security_token
  @security_token
end

#session_idObject

Returns the value of attribute session_id.



8
9
10
# File 'lib/bulkforce/configuration.rb', line 8

def session_id
  @session_id
end

#usernameObject

Returns the value of attribute username.



4
5
6
# File 'lib/bulkforce/configuration.rb', line 4

def username
  @username
end

Instance Method Details

#to_hObject



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