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
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #api_url ⇒ Object
- #environment ⇒ Object
-
#initialize(api_key, options = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(api_key, options = {}) ⇒ Config
Returns a new instance of Config.
12 13 14 15 |
# File 'lib/kentaa/api/config.rb', line 12 def initialize(api_key, = {}) @api_key = api_key = end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
10 11 12 |
# File 'lib/kentaa/api/config.rb', line 10 def api_key @api_key end |
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/kentaa/api/config.rb', line 10 def end |
Instance Method Details
#api_url ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/kentaa/api/config.rb', line 17 def api_url case environment when :test TEST_URL when :development DEV_URL when :live LIVE_URL end end |
#environment ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/kentaa/api/config.rb', line 28 def environment if [:test] :test elsif [:dev] :development else :live end end |