Class: Optimum::Configuration

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

Constant Summary collapse

API_DOMAINS =
{
  production: 'https://core.optimumfinance.co.uk',
  development: 'https://optimum-core-staging.herokuapp.com'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



13
14
15
16
17
18
# File 'lib/optimum/configuration.rb', line 13

def initialize
  @introducer_id = ''
  @webhook_signature = ''
  @env = defined?(Rails) ? Rails.env : :development
  @debug = false
end

Instance Attribute Details

#debug=(value) ⇒ Object (writeonly)

Sets the attribute debug

Parameters:

  • value

    the value to set the attribute debug to.



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

def debug=(value)
  @debug = value
end

#envObject

Returns the value of attribute env.



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

def env
  @env
end

#introducer_idObject

Returns the value of attribute introducer_id.



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

def introducer_id
  @introducer_id
end

Instance Method Details

#api_domainObject



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

def api_domain
  API_DOMAINS[@env.to_sym] || API_DOMAINS[:development]
end

#debug?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/optimum/configuration.rb', line 20

def debug?
  @debug
end