fitbit_api 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/fitbit_api/alarms.rb +1 -1
- data/lib/fitbit_api/food.rb +8 -8
- data/lib/fitbit_api/meals.rb +5 -5
- data/lib/fitbit_api/sleep.rb +1 -1
- data/lib/fitbit_api/user.rb +1 -1
- data/lib/fitbit_api/version.rb +1 -1
- data/lib/fitbit_api/water.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78cae3c27a67636b099e84c993d65ca42e2039dd3caba794df413baf947dc7eb
|
4
|
+
data.tar.gz: 8cd276fc40a20b3592c54e7b4e53f86b450ce8b6f57160151080f9bf8586b557
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f197a5a6e3e8bd08c3d435b44fde8953716f9a1a589d6ea46ae469bb875b77ee39b1f0a289d1e66cd5f2bd055051e5f7dad73f468c628ab9a5ce4f41be7b0758
|
7
|
+
data.tar.gz: 062e014f64ab3780554c2e8f705bcee89a9c74ce3d2119371230207849fb991d777197722641f55cb9983186aa0a97960218eb7413e766fd9ff41e07557226ab
|
data/CHANGELOG.md
CHANGED
data/lib/fitbit_api/alarms.rb
CHANGED
@@ -2,7 +2,7 @@ module FitbitAPI
|
|
2
2
|
class Client
|
3
3
|
# Returns a list of the set alarms connected to a user's account.
|
4
4
|
#
|
5
|
-
# @
|
5
|
+
# @param tracker_id [Integer] The ID of the tracker for which the data is returned
|
6
6
|
|
7
7
|
def alarms(tracker_id)
|
8
8
|
get("user/#{user_id}/devices/tracker/#{tracker_id}/alarms.json")
|
data/lib/fitbit_api/food.rb
CHANGED
@@ -8,7 +8,7 @@ module FitbitAPI
|
|
8
8
|
|
9
9
|
# Retrieves a list of public foods from the Fitbit foods database and private foods the user created
|
10
10
|
#
|
11
|
-
# @
|
11
|
+
# @param query [String] The search query
|
12
12
|
|
13
13
|
def search_foods(params)
|
14
14
|
get("foods/search.json", params)
|
@@ -28,7 +28,7 @@ module FitbitAPI
|
|
28
28
|
|
29
29
|
# Creates a new private food for a user
|
30
30
|
#
|
31
|
-
# @
|
31
|
+
# @param body [Hash] The POST request body
|
32
32
|
|
33
33
|
def create_food(body)
|
34
34
|
post("user/#{user_id}/foods.json", body)
|
@@ -36,7 +36,7 @@ module FitbitAPI
|
|
36
36
|
|
37
37
|
# Deletes a custom food created by the user
|
38
38
|
#
|
39
|
-
# @
|
39
|
+
# @param food_id [Integer] The ID of the food to be deleted
|
40
40
|
|
41
41
|
def delete_food(food_id)
|
42
42
|
delete("user/#{user_id}/foods/#{food_id}.json")
|
@@ -44,7 +44,7 @@ module FitbitAPI
|
|
44
44
|
|
45
45
|
# Creates a food log entry
|
46
46
|
#
|
47
|
-
# @
|
47
|
+
# @param body [Hash] The POST request body
|
48
48
|
|
49
49
|
def create_food_log(body)
|
50
50
|
post("user/#{user_id}/foods/log.json", body)
|
@@ -52,8 +52,8 @@ module FitbitAPI
|
|
52
52
|
|
53
53
|
# Updates the quantity or calories consumed for a user's food log entry with the given Food Log ID
|
54
54
|
#
|
55
|
-
# @
|
56
|
-
# @
|
55
|
+
# @param food_log_id [Integer] The ID of the food log to edit
|
56
|
+
# @param body [Hash] The POST request body
|
57
57
|
|
58
58
|
def update_food_log(food_log_id, body)
|
59
59
|
post("user/#{user_id}/foods/log/#{food_log_id}.json", body)
|
@@ -61,7 +61,7 @@ module FitbitAPI
|
|
61
61
|
|
62
62
|
# Deletes a user's food log entry using the given log ID
|
63
63
|
#
|
64
|
-
# @
|
64
|
+
# @param food_log_id [Integer] The id of the food log entry
|
65
65
|
|
66
66
|
def delete_food_log(food_log_id)
|
67
67
|
delete("user/#{user_id}/foods/log/#{food_log_id}.json")
|
@@ -75,7 +75,7 @@ module FitbitAPI
|
|
75
75
|
|
76
76
|
# Deletes a food with the given ID from the user's list of favorite foods
|
77
77
|
#
|
78
|
-
# @
|
78
|
+
# @param food_id [Integer] The ID of the food to delete from the user's favorites
|
79
79
|
|
80
80
|
def delete_favorite_food(food_id)
|
81
81
|
delete("user/#{user_id}/foods/log/favorite/#{food_id}.json")
|
data/lib/fitbit_api/meals.rb
CHANGED
@@ -8,7 +8,7 @@ module FitbitAPI
|
|
8
8
|
|
9
9
|
# Retrieves a single meal created by the user from their food log given the meal id
|
10
10
|
#
|
11
|
-
# @
|
11
|
+
# @param meal_id [Integer] The ID of the meal
|
12
12
|
|
13
13
|
def meal(meal_id)
|
14
14
|
get("user/#{user_id}/meals/#{meal_id}.json")
|
@@ -16,7 +16,7 @@ module FitbitAPI
|
|
16
16
|
|
17
17
|
# Creates a meal with the given food
|
18
18
|
#
|
19
|
-
# @
|
19
|
+
# @param body [Hash] The POST request body
|
20
20
|
|
21
21
|
def create_meal(body)
|
22
22
|
post("user/#{user_id}/meals.json", body)
|
@@ -24,8 +24,8 @@ module FitbitAPI
|
|
24
24
|
|
25
25
|
# Updates an existing meal with the contents of the request
|
26
26
|
#
|
27
|
-
# @
|
28
|
-
# @
|
27
|
+
# @param meal_id [Integer] The ID of the meal
|
28
|
+
# @param body [Hash] The POST request body
|
29
29
|
|
30
30
|
def update_meal(meal_id, body)
|
31
31
|
post("user/#{user_id}/meals/#{meal_id}.json", body)
|
@@ -33,7 +33,7 @@ module FitbitAPI
|
|
33
33
|
|
34
34
|
# Deletes an existing meal of the given meal ID
|
35
35
|
#
|
36
|
-
# @
|
36
|
+
# @param meal_id [Integer] The ID of the meal
|
37
37
|
|
38
38
|
def delete_meal(meal_id)
|
39
39
|
delete("user/#{user_id}/meals/#{meal_id}.json")
|
data/lib/fitbit_api/sleep.rb
CHANGED
@@ -7,7 +7,7 @@ module FitbitAPI
|
|
7
7
|
# periods that began on the previous date. For example, if you request a Sleep Log for 2021-12-22,
|
8
8
|
# it may return a log entry that began the previous night on 2021-12-21, but ended on 2021-12-22.
|
9
9
|
#
|
10
|
-
# @
|
10
|
+
# @param date [Date, String] The date for the sleep log to be returned in the format yyyy-MM-dd
|
11
11
|
|
12
12
|
def sleep_logs(date=Date.today)
|
13
13
|
get("user/#{user_id}/sleep/date/#{format_date(date)}.json")
|
data/lib/fitbit_api/user.rb
CHANGED
data/lib/fitbit_api/version.rb
CHANGED
data/lib/fitbit_api/water.rb
CHANGED
@@ -18,8 +18,8 @@ module FitbitAPI
|
|
18
18
|
|
19
19
|
# Updates the quantity consumed for a user's water log entry with the given log ID
|
20
20
|
#
|
21
|
-
# @
|
22
|
-
# @
|
21
|
+
# @param water_log_id [Integer] The ID of the water log to be updated
|
22
|
+
# @param body [Hash] The POST request body for updating the water log
|
23
23
|
|
24
24
|
def update_water_log(water_log_id, body)
|
25
25
|
post("user/#{user_id}/foods/log/water/#{water_log_id}.json", body)
|