Class: NikeRb::Client
- Inherits:
-
Object
- Object
- NikeRb::Client
- Defined in:
- lib/nike_rb.rb
Instance Method Summary collapse
- #current_fuel(options = {}) ⇒ Object
-
#initialize(access_token) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(access_token) ⇒ Client
Returns a new instance of Client.
19 20 21 |
# File 'lib/nike_rb.rb', line 19 def initialize(access_token) @access_token = access_token end |
Instance Method Details
#current_fuel(options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/nike_rb.rb', line 23 def current_fuel(={}) params = "#{API_URI}/me/sport/activities?access_token=#{@access_token}" if [:count] params << "&count=#{[:count]}" end response = HTTParty.get("#{params}", headers: HEADERS) body = JSON.parse response.body return body end |