Skip to content

Commit

Permalink
address rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
zokioki committed Dec 28, 2023
1 parent 5281bff commit d3df8fc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/fitbit_api/active_zone_minutes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def active_zone_minutes_time_series(opts = {})
result = if period
get("user/#{user_id}/activities/active-zone-minutes/date/#{format_date(end_date)}/#{period}.json")
else
get("user/#{user_id}/activities/active-zone-minutes/date/#{format_date(start_date)}/#{format_date(end_date)}.json")
get(
"user/#{user_id}/activities/active-zone-minutes/date/" \
"#{format_date(start_date)}/#{format_date(end_date)}.json"
)
end

strip_root_key(result)
Expand All @@ -53,9 +56,11 @@ def active_zone_minutes_intraday_time_series(opts = {})
raise FitbitAPI::InvalidArgumentError, 'A date and detail_level are required.'
end

unless %(1min 5min 15min).include? detail_level
detail_levels = %(1min 5min 15min)

unless detail_levels.include? detail_level
raise FitbitAPI::InvalidArgumentError,
"Invalid detail_level: \"#{detail_level}\". Please provide one of the following: \"1min\", \"5min\" or \"15min\"."
"Invalid detail_level: \"#{detail_level}\". Please provide one of the following: #{detail_levels}."
end

if (start_time || end_time) && !(start_time && end_time)
Expand Down

0 comments on commit d3df8fc

Please sign in to comment.