fitbit_api 0.15.3 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35ca25eddb9d20edb608f8ba914c32b0056484d730c9b1c671385af4348320f0
4
- data.tar.gz: c79bc99fda06b0f6ad0f2ad321acf371ed619353c13c44d8225efa2263929358
3
+ metadata.gz: 84c71b886a0267daec62f3be7c7a4f1b8da73a893cb766b3a0a246089f5bded0
4
+ data.tar.gz: f662e151b49f846953dd278676c0bb70d5f473b33ce5727df2a496311f09fcf7
5
5
  SHA512:
6
- metadata.gz: 5c35f3405ae380230338376184bda00152619b94bbc91a4eba3075b3dee0c4906da2327967733c17fd5cf3097dbf75ff123e6e8c55f15159a4476e4085573a46
7
- data.tar.gz: 5e136456daf9ec21fbb2fd89fb5b8ab001c3a99cce3b51ebd007fd320a79d1dcd530463d51b6976057541c6b39cfe152509c5829a160ac7bf7d9cade23f8c41e
6
+ metadata.gz: '03948d366e08835c27d58c128c654c46c8a11ad8eb306de10a8584aae78d0e6c885e9a6ee3e4d4a3a1a60bb45dafe1b807c57649c3dc9eb58af85381845323c3'
7
+ data.tar.gz: 6b39da3d88cd2f0440196a9ce52466950892bf25af5e5ecb60a5f9438c0a14d14b48f10cf4b792151b4d23da1e52086ac7767b9a6ad82b7c00ea3cabf1858aa0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.16.0
2
+ ------
3
+ - Add Sleep Log by Date Range endpoint support
4
+
1
5
  0.15.3
2
6
  ------
3
7
  - Use strict encoding for auth tokens
@@ -15,6 +15,25 @@ module FitbitAPI
15
15
  get("user/#{user_id}/sleep/date/#{format_date(date)}.json")
16
16
  end
17
17
 
18
+ # Returns a list of a user's sleep log entries for a given date range. The data returned for either date
19
+ # can include a sleep period that ended that date but began on the previous date. For example, if you
20
+ # request a Sleep Log between 2021-12-22 and 2021-12-26, it may return log entries that span 2021-12-21
21
+ # and 2021-12-22, as well as 2021-12-25 and 2021-12-26.
22
+ #
23
+ # @param opts [Hash] The request options
24
+ #
25
+ # @option opts :start_date [Date] The start of the date range
26
+ # @option opts :end_date [Date] The end of the date range
27
+
28
+ def sleep_logs_by_date_range(opts = {})
29
+ start_date = opts[:start_date]
30
+ end_date = opts[:end_date]
31
+
32
+ raise FitbitAPI::InvalidArgumentError, 'A start_date and end_date are required.' unless start_date && end_date
33
+
34
+ get("user/#{user_id}/sleep/date/#{format_date(start_date)}/#{format_date(end_date)}.json")
35
+ end
36
+
18
37
  # Returns a list of a user's sleep log entries before or after a given date, and specifying offset,
19
38
  # limit and sort order. The data returned for different dates can include sleep periods that began
20
39
  # on the previous date. For example, a sleep log entry for 2018-10-21 may have ended that day but
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FitbitAPI
4
- VERSION = '0.15.3'
4
+ VERSION = '0.16.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fitbit_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.3
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zoran
@@ -119,8 +119,8 @@ licenses:
119
119
  - MIT
120
120
  metadata:
121
121
  source_code_uri: https://github.com/zokioki/fitbit_api
122
- changelog_uri: https://github.com/zokioki/fitbit_api/blob/v0.15.3/CHANGELOG.md
123
- documentation_uri: https://www.rubydoc.info/gems/fitbit_api/0.15.3
122
+ changelog_uri: https://github.com/zokioki/fitbit_api/blob/v0.16.0/CHANGELOG.md
123
+ documentation_uri: https://www.rubydoc.info/gems/fitbit_api/0.16.0
124
124
  rubygems_mfa_required: 'true'
125
125
  post_install_message:
126
126
  rdoc_options: []