Class: FractalApi::Configuration

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

Constant Summary collapse

BASE_URLS =
{
  production: 'https://apis.askfractal.com',
  sandbox: 'https://apis.julia-laces.co.uk'
}.freeze
AUTH_URLS =
{
  production: 'https://auth.askfractal.com',
  sandbox: 'https://auth.julia-laces.co.uk'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



16
17
18
19
20
21
22
# File 'lib/fractal_api/configuration.rb', line 16

def initialize
  @api_key = ''
  @partner_id = ''
  @webhook_secret = ''
  @environment = :sandbox # can be either :sandbox or :production
  @debug = false
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



14
15
16
# File 'lib/fractal_api/configuration.rb', line 14

def api_key
  @api_key
end

#debugObject

Returns the value of attribute debug.



14
15
16
# File 'lib/fractal_api/configuration.rb', line 14

def debug
  @debug
end

#environmentObject

Returns the value of attribute environment.



14
15
16
# File 'lib/fractal_api/configuration.rb', line 14

def environment
  @environment
end

#partner_idObject

Returns the value of attribute partner_id.



14
15
16
# File 'lib/fractal_api/configuration.rb', line 14

def partner_id
  @partner_id
end

#webhook_secretObject

Returns the value of attribute webhook_secret.



14
15
16
# File 'lib/fractal_api/configuration.rb', line 14

def webhook_secret
  @webhook_secret
end

Instance Method Details

#auth_urlObject



28
29
30
# File 'lib/fractal_api/configuration.rb', line 28

def auth_url
  AUTH_URLS[environment.to_sym]
end

#base_urlObject



24
25
26
# File 'lib/fractal_api/configuration.rb', line 24

def base_url
  BASE_URLS[environment.to_sym]
end