Class: Kentaa::Api::Config
- Inherits:
-
Object
- Object
- Kentaa::Api::Config
- Defined in:
- lib/kentaa/api/config.rb
Constant Summary collapse
- LIVE_URL =
'https://api.kentaa.nl/v1'
- TEST_URL =
'https://api.kentaa.staatklaar.nu/v1'
- DEV_URL =
'http://api.lvh.me:3000/v1'
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #api_key ⇒ Object
- #api_url ⇒ Object
- #debug? ⇒ Boolean
- #environment ⇒ Object
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
12 13 14 |
# File 'lib/kentaa/api/config.rb', line 12 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/kentaa/api/config.rb', line 10 def @options end |
Instance Method Details
#api_key ⇒ Object
16 17 18 |
# File 'lib/kentaa/api/config.rb', line 16 def api_key .fetch(:api_key) end |
#api_url ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/kentaa/api/config.rb', line 20 def api_url case environment when :test TEST_URL when :development DEV_URL when :live LIVE_URL end end |
#debug? ⇒ Boolean
41 42 43 |
# File 'lib/kentaa/api/config.rb', line 41 def debug? .fetch(:debug, false) end |
#environment ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/kentaa/api/config.rb', line 31 def environment if [:test] :test elsif [:dev] :development else :live end end |