Class: Optimum::Configuration
- Inherits:
-
Object
- Object
- Optimum::Configuration
- 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
-
#debug ⇒ Object
writeonly
Sets the attribute debug.
-
#env ⇒ Object
Returns the value of attribute env.
-
#introducer_id ⇒ Object
Returns the value of attribute introducer_id.
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/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
6 7 8 |
# File 'lib/optimum/configuration.rb', line 6 def debug=(value) @debug = value end |
#env ⇒ Object
Returns the value of attribute env.
5 6 7 |
# File 'lib/optimum/configuration.rb', line 5 def env @env end |
#introducer_id ⇒ Object
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_domain ⇒ Object
24 25 26 |
# File 'lib/optimum/configuration.rb', line 24 def api_domain API_DOMAINS[@env.to_sym] || API_DOMAINS[:development] end |
#debug? ⇒ Boolean
20 21 22 |
# File 'lib/optimum/configuration.rb', line 20 def debug? @debug end |