smileback 0.2.1 → 0.3.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: b05d7351a144ae46723b829b59dc9ec1d8f34e8aecedadefdfd05b9af5174ad7
4
- data.tar.gz: 51bc40e7062542827a4215e499b812c97a17ede35aa5cb94c0cd6be17265e805
3
+ metadata.gz: 7d82ea5157757d5f5627be6d0a05f1d0fae2af553bc3f78b0c13930f2761be2d
4
+ data.tar.gz: acecbc4969ca0e162b5265fbd66a8e051d80355dfb376a7f8fcf64d3bdb84da3
5
5
  SHA512:
6
- metadata.gz: 24ed8691fffda99b3739df1f3eb5020cee646874e6c701bc29add00208d5c7b875f29c64d11290dd47074f550a93564d0119a35e92dd057174608de05d35b661
7
- data.tar.gz: 48481e6060e920d4bcfb30344954082fa46bcb0ae488ebe4e7521c668d507e06677d0bc709e9af41cc76a1bedf4bffaaa63f888af7e3e352981d43ad7e065fd9
6
+ metadata.gz: c4e434fb2718b59fff288b7d868c3018728b06fb4ebf9cc64a3716f6a7e0602352c690fabb43ab2ed401365d19354465f12c06946c1b8efe8bc382e5570e958e
7
+ data.tar.gz: d00e3669245d57351c20dcdbdf000d8a3bb371eb009f600536754d95dd010fa3d44e4d94a67bbdc237309147594b589d3f76d2ba74097fb46832064e8b044973
@@ -1,3 +1,3 @@
1
1
  module Smileback
2
- VERSION = "0.2.1"
2
+ VERSION = '0.3.0'
3
3
  end
data/lib/smileback.rb CHANGED
@@ -10,6 +10,8 @@ module Smileback
10
10
 
11
11
  debug_output $stdout
12
12
 
13
+ attr_accessor :access_token
14
+
13
15
  def initialize(token:, refresh_token:, expires_at:, expires: true)
14
16
  self.class.base_uri Smileback.configuration.api_base_url
15
17
 
@@ -25,9 +27,9 @@ module Smileback
25
27
  # @return [Hash]
26
28
  def credentials
27
29
  {
28
- token: @access_token.token,
29
- refresh_token: @access_token.refresh_token,
30
- expires_at: @access_token.expires_at,
30
+ token: access_token.token,
31
+ refresh_token: access_token.refresh_token,
32
+ expires_at: access_token.expires_at,
31
33
  expires: true
32
34
  }
33
35
  end
@@ -38,10 +40,10 @@ module Smileback
38
40
  # @param query [Hash] query params; { modified_since: '2017-10-27T07:43:15Z' }
39
41
  # @return [HTTParty::Response]
40
42
  def get(path, query = {})
41
- @access_token.refresh! if @access_token.expired?
43
+ access_token.refresh! if access_token.expired?
42
44
 
43
45
  self.class.get(path, {
44
- headers: { Authorization: "Bearer #{@access_token.token}" },
46
+ headers: { Authorization: "Bearer #{access_token.token}" },
45
47
  query: query
46
48
  })
47
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smileback
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Pheasey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-21 00:00:00.000000000 Z
11
+ date: 2018-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth