Class: PebbleTimeline::API
- Inherits:
-
Object
- Object
- PebbleTimeline::API
- Defined in:
- lib/pebble_timeline/api.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ API
constructor
A new instance of API.
Constructor Details
#initialize ⇒ API
Returns a new instance of API.
3 4 5 6 7 8 |
# File 'lib/pebble_timeline/api.rb', line 3 def initialize raise ConfigMissingAPIKeyError, 'You must provide an API Key' unless PebbleTimeline.config.api_key @api_key = PebbleTimeline.config.api_key @base_url = PebbleTimeline.config.base_url end |
Class Method Details
.call(url, http_method, params = {}) ⇒ Object
10 11 12 13 14 |
# File 'lib/pebble_timeline/api.rb', line 10 def self.call(url, http_method, params={}) @api ||= self.new response = @api.send(http_method, url, params) response.body end |