fitbit_api 0.14.1 → 0.14.2

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: 35736e8dc53586ada210b2dc0431c619eed07d79001e5211283561f3922a2a2d
4
- data.tar.gz: 36001c0eceb88dac465f1eabe2af276b009e504eef1ad39cdbcb105077b51df0
3
+ metadata.gz: 417f3489c6b33f4acc4d8eebf14048c5a50b4f86905679f04a436472aea67bd7
4
+ data.tar.gz: 01ebe9bcc0db08753267015b0ac50a4950c8394c1f7b8563298d2b7657544007
5
5
  SHA512:
6
- metadata.gz: 114303eb86c474c7e5e8c7338d5ff40e0febfb2c56fd85988cadd1a87c26babb535fa0829692f2582505f99e0a5434dae557f91b5a2a09f0be5ef06495db520d
7
- data.tar.gz: 67594641c25ca473c4aa0edb6f96a84616805a0b1fbd4272483645d3e0f167d05be2412ae4b0fa996a1ceab88387b8701d1466bef554226ca3ee0d3fa134e1f5
6
+ metadata.gz: 66c83ce386d49728e5ec75f4e343c18a015f776c6cc8b8721ff1c4e2700098ece8f1c6b2c3788a7cc1521d3f1302319f25552ea7a1a70b0b9a93ffd0d8e47d52
7
+ data.tar.gz: 4e97184f094af8aed5a1fd8ea427a9be8c128ebbe439990a8c933a3463c7b8ddb0b31b64ce512d5998118a8f1988aa0ed56ad6009f6045e282d06fc131723bc3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.14.2
2
+ ------
3
+ - Add documentation for more methods
4
+
1
5
  0.14.1
2
6
  ------
3
7
  - Add documentation for several methods
@@ -31,10 +31,16 @@ module FitbitAPI
31
31
  establish_token(opts)
32
32
  end
33
33
 
34
+ # Returns the authorize endpoint URL of the OAuth2 provider.
35
+
34
36
  def auth_url
35
37
  @client.auth_code.authorize_url(redirect_uri: @redirect_uri, scope: @scope)
36
38
  end
37
39
 
40
+ # Returns an OAuth2::AccessToken instance obtained from the given authorization code.
41
+ #
42
+ # @param auth_code [String] An authorization code
43
+
38
44
  def get_token(auth_code)
39
45
  @token = @client.auth_code.get_token(
40
46
  auth_code,
@@ -45,6 +51,8 @@ module FitbitAPI
45
51
  @token
46
52
  end
47
53
 
54
+ # Refreshes the current Access Token.
55
+
48
56
  def refresh_token!
49
57
  @token = @token.refresh!(headers: auth_headers)
50
58
  @user_id ||= @token.params['user_id']
@@ -53,6 +61,8 @@ module FitbitAPI
53
61
  @token
54
62
  end
55
63
 
64
+ # Revokes the user's authorizations and all associated tokens.
65
+
56
66
  def revoke_token!
57
67
  body = { token: token.token }
58
68
  headers = default_request_headers.merge(auth_headers)
@@ -61,14 +71,32 @@ module FitbitAPI
61
71
  process_keys!(MultiJson.load(response.body))
62
72
  end
63
73
 
74
+ # Performs an authorized GET request to the configured API namespace.
75
+ #
76
+ # @param path [String] The request path
77
+ # @param params [Hash] The query parameters
78
+ # @param opts [Hash] Additional request options (e.g. headers)
79
+
64
80
  def get(path, params={}, opts={}, &block)
65
81
  request(:get, path, opts.merge(params: params), &block)
66
82
  end
67
83
 
84
+ # Performs an authorized POST request to the configured API namespace.
85
+ #
86
+ # @param path [String] The request path
87
+ # @param body [Hash] The request body
88
+ # @param opts [Hash] Additional request options (e.g. headers)
89
+
68
90
  def post(path, body={}, opts={}, &block)
69
91
  request(:post, path, opts.merge(body: body), &block)
70
92
  end
71
93
 
94
+ # Performs an authorized DELETE request to the configured API namespace.
95
+ #
96
+ # @param path [String] The request path
97
+ # @param params [Hash] The query parameters
98
+ # @param opts [Hash] Additional request options (e.g. headers)
99
+
72
100
  def delete(path, params={}, opts={}, &block)
73
101
  request(:delete, path, opts.merge(params: params), &block)
74
102
  end
@@ -1,3 +1,3 @@
1
1
  module FitbitAPI
2
- VERSION = '0.14.1'
2
+ VERSION = '0.14.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fitbit_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zoran
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-06 00:00:00.000000000 Z
11
+ date: 2022-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2