lib/fitbit_api/sleep.rb in fitbit_api-0.9.0 vs lib/fitbit_api/sleep.rb in fitbit_api-0.9.1
- old
+ new
@@ -23,12 +23,12 @@
if period && !PERIODS.include?(period)
raise FitbitAPI::InvalidArgumentError, "Invalid period: \"#{period}\". Please provide one of the following: #{PERIODS}."
end
if period
- result = get("user/#{user_id}/activities/#{resource}/date/#{format_date(end_date)}/#{period}.json", opts)
+ result = get("user/#{user_id}/sleep/#{resource}/date/#{format_date(end_date)}/#{period}.json", opts)
else
- result = get("user/#{user_id}/activities/#{resource}/date/#{format_date(start_date)}/#{format_date(end_date)}.json", opts)
+ result = get("user/#{user_id}/sleep/#{resource}/date/#{format_date(start_date)}/#{format_date(end_date)}.json", opts)
end
# remove root key from response
result.values[0]
end
end