Class: NikeRb::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/nike_rb.rb

Instance Method Summary collapse

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(options={})
 	params = "#{API_URI}/me/sport/activities?access_token=#{@access_token}"
 	if options[:count]
 		params << "&count=#{options[:count]}"
 	end

	response = HTTParty.get("#{params}", headers: HEADERS)
	body = JSON.parse response.body

	return body
end