Class: Iwoca::Configuration
- Inherits:
-
Object
- Object
- Iwoca::Configuration
- 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
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#debug ⇒ Object
writeonly
Sets the attribute debug.
-
#env ⇒ Object
Returns the value of attribute env.
-
#webhook_signature ⇒ Object
Returns the value of attribute webhook_signature.
Instance Method Summary collapse
- #api_domain ⇒ Object
- #debug? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_key ⇒ Object
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
6 7 8 |
# File 'lib/iwoca/configuration.rb', line 6 def debug=(value) @debug = value end |
#env ⇒ Object
Returns the value of attribute env.
5 6 7 |
# File 'lib/iwoca/configuration.rb', line 5 def env @env end |
#webhook_signature ⇒ Object
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_domain ⇒ Object
24 25 26 |
# File 'lib/iwoca/configuration.rb', line 24 def api_domain API_DOMAINS[@env.to_sym] || API_DOMAINS[:development] end |
#debug? ⇒ Boolean
20 21 22 |
# File 'lib/iwoca/configuration.rb', line 20 def debug? @debug end |