fitgem_oauth2 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fitgem_oauth2/client.rb +3 -1
- data/lib/fitgem_oauth2/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb51e84b554b9bfd42cf907270a1e106073df925
|
4
|
+
data.tar.gz: 5b8892fc431c2246761155624c34f41c3772803b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a1607113fa93cc5ffdd266884101a8d857c5bee78b2c6d1c959006b83692c018b03044516f7ef320d0d17a2d89bc9e2db071dbf9b8538091ade106114aada4d
|
7
|
+
data.tar.gz: e106e723fd46fe78939a22c4904ca5126675155333f196c5ec091f50e734fb0f771176ad1f5b77d66d285ab192cd382375d18186a49cb05d5b0cf1e2e46aa632
|
data/lib/fitgem_oauth2/client.rb
CHANGED
@@ -24,6 +24,7 @@ module FitgemOauth2
|
|
24
24
|
attr_reader :client_secret
|
25
25
|
attr_reader :token
|
26
26
|
attr_reader :user_id
|
27
|
+
attr_reader :unit_system
|
27
28
|
|
28
29
|
def initialize(opts)
|
29
30
|
missing = [:client_id, :client_secret, :token] - opts.keys
|
@@ -35,7 +36,7 @@ module FitgemOauth2
|
|
35
36
|
@client_secret = opts[:client_secret]
|
36
37
|
@token = opts[:token]
|
37
38
|
@user_id = (opts[:user_id] || DEFAULT_USER_ID)
|
38
|
-
|
39
|
+
@unit_system = opts[:unit_system]
|
39
40
|
@connection = Faraday.new('https://api.fitbit.com')
|
40
41
|
end
|
41
42
|
|
@@ -74,6 +75,7 @@ module FitgemOauth2
|
|
74
75
|
def set_headers(request)
|
75
76
|
request.headers['Authorization'] = "Bearer #{token}"
|
76
77
|
request.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
78
|
+
request.headers['Accept-Language'] = unit_system unless unit_system == nil
|
77
79
|
end
|
78
80
|
|
79
81
|
def parse_response(response)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fitgem_oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ankit Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -107,8 +107,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.4.6
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Fitbit API client library
|
114
114
|
test_files: []
|
115
|
+
has_rdoc:
|