Class: Untappd::API
Direct Known Subclasses
Instance Method Summary collapse
- #application_key=(val) ⇒ Object
-
#endpoint=(val) ⇒ Object
Override these setters so that HTTParty class methods get updated as well.
-
#initialize(options = {}) ⇒ API
constructor
Create a new API.
Constructor Details
#initialize(options = {}) ⇒ API
Create a new API
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/untappd-api/api.rb', line 21 def initialize(={}) @klass = self.class = Untappd..merge() Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", [key]) end # Set HTTParty class configurations @klass.format(:json) end |
Instance Method Details
#application_key=(val) ⇒ Object
15 16 17 18 |
# File 'lib/untappd-api/api.rb', line 15 def application_key=(val) @application_key = val @klass.default_params(:key => application_key) end |
#endpoint=(val) ⇒ Object
Override these setters so that HTTParty class methods get updated as well
10 11 12 13 |
# File 'lib/untappd-api/api.rb', line 10 def endpoint=(val) @endpoint = val @klass.base_uri(endpoint) end |