Class: Iwoca::Configuration

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

Constant Summary collapse

API_DOMAINS =
{
  production: 'https://www.iwoca.co.uk',
  development: 'https://stage.iwoca-dev.co.uk'
}.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/iwoca/configuration.rb', line 13

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

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



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

def api_key
  @api_key
end

#debug=(value) ⇒ Object (writeonly)

Sets the attribute debug

Parameters:

  • value

    the value to set the attribute debug to.



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

def debug=(value)
  @debug = value
end

#envObject

Returns the value of attribute env.



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

def env
  @env
end

#webhook_signatureObject

Returns the value of attribute webhook_signature.



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

def webhook_signature
  @webhook_signature
end

Instance Method Details

#api_domainObject



24
25
26
# File 'lib/iwoca/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/iwoca/configuration.rb', line 20

def debug?
  @debug
end