Class: Truelayer::Configuration

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

Constant Summary collapse

BASE_URLS =
{
  production: 'https://api.truelayer.com',
  sandbox: 'https://api.truelayer-sandbox.com'
}.freeze
AUTH_URLS =
{
  production: 'https://auth.truelayer.com',
  sandbox: 'https://auth.truelayer-sandbox.com'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/truelayer/configuration.rb', line 18

def initialize
  @client_id = ''
  @client_secret = ''
  @environment = :sandbox # can be either :sandbox or :production
  @debug = false
  @verbose = false

  #return if Faraday::Request.fetch_middleware(:truelayer_auth)

  #Faraday::Request.register_middleware truelayer_auth: -> { Truelayer::FaradayAuth }
end

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



16
17
18
# File 'lib/truelayer/configuration.rb', line 16

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



16
17
18
# File 'lib/truelayer/configuration.rb', line 16

def client_secret
  @client_secret
end

#debugObject

Returns the value of attribute debug.



16
17
18
# File 'lib/truelayer/configuration.rb', line 16

def debug
  @debug
end

#environmentObject

Returns the value of attribute environment.



16
17
18
# File 'lib/truelayer/configuration.rb', line 16

def environment
  @environment
end

#verboseObject

Returns the value of attribute verbose.



16
17
18
# File 'lib/truelayer/configuration.rb', line 16

def verbose
  @verbose
end

Instance Method Details

#auth_urlObject



34
35
36
# File 'lib/truelayer/configuration.rb', line 34

def auth_url
  AUTH_URLS[environment.to_sym]
end

#base_urlObject



30
31
32
# File 'lib/truelayer/configuration.rb', line 30

def base_url
  BASE_URLS[environment.to_sym]
end