fitbit_client 0.1.3 → 0.1.4
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/lib/fitbit_client.rb +1 -1
- data/lib/fitbit_client/resources/body_and_weight.rb +13 -8
- data/lib/fitbit_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e45bd29c4662b61ee8ec77332d5eebcda95e0577
|
4
|
+
data.tar.gz: bdd1b83f3f8ae401f2935f9b619a3d7ab058b0ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82aeeba5a60f2ebeab6e630205176bb700799ab8bbdf73a3a90ec41b10953acf4006c322cb67c631e0547e4c524cf3497420b82b7e11e1df8adb85b04957db08
|
7
|
+
data.tar.gz: 92d198027cc9140db0a2a1e1b6214066f5a031773e24497e38de50492927979e81a4abb0045791fbf2be32f6aa3d52da39f67df3d45bed88c4846b3290a0b219
|
data/lib/fitbit_client.rb
CHANGED
@@ -11,8 +11,9 @@ module FitbitClient
|
|
11
11
|
#
|
12
12
|
# Body weight log entries in response are sorted exactly the same as they
|
13
13
|
# are presented on the Fitbit website.
|
14
|
-
def weight_logs(date,
|
15
|
-
|
14
|
+
def weight_logs(date, period_or_end_date = nil, options = {})
|
15
|
+
path = body_and_weight_path_for_period('weight', date, period_or_end_date)
|
16
|
+
get_json(path_user_version(path, options))
|
16
17
|
end
|
17
18
|
|
18
19
|
# The Log Weight API creates log entry for a body weight using units in
|
@@ -98,12 +99,7 @@ module FitbitClient
|
|
98
99
|
#
|
99
100
|
# <b>Note:</b> The range should not be longer than 31 days.
|
100
101
|
def body_fat_logs(date, period_or_end_date = nil, options = {})
|
101
|
-
|
102
|
-
end_limit = period_or_date_param(period_or_end_date)
|
103
|
-
path = "/body/log/fat/date/#{iso_date(date)}/#{end_limit}"
|
104
|
-
else
|
105
|
-
path = "/body/log/fat/date/#{iso_date(date)}"
|
106
|
-
end
|
102
|
+
path = body_and_weight_path_for_period('fat', date, period_or_end_date)
|
107
103
|
get_json(path_user_version(path, options))
|
108
104
|
end
|
109
105
|
|
@@ -140,6 +136,15 @@ module FitbitClient
|
|
140
136
|
params['weight'] = weight if weight
|
141
137
|
params
|
142
138
|
end
|
139
|
+
|
140
|
+
def body_and_weight_path_for_period(type, date, period_or_end_date)
|
141
|
+
if period_or_end_date
|
142
|
+
end_limit = period_or_date_param(period_or_end_date)
|
143
|
+
"/body/log/#{type}/date/#{iso_date(date)}/#{end_limit}"
|
144
|
+
else
|
145
|
+
"/body/log/#{type}/date/#{iso_date(date)}"
|
146
|
+
end
|
147
|
+
end
|
143
148
|
end
|
144
149
|
end
|
145
150
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fitbit_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michel Ocon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|