open_api_smart_recruiters_sdk 0.2.3 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69301773d1e7db3606b1b3edea6b57018249cbd1de378a1a308bc756b192a9da
4
- data.tar.gz: 707d373570b9ee8901e8809c21e3dd2d3672e3a9010703dc4002d21d29e9eb25
3
+ metadata.gz: 439f69e8d60e69b97fe4653a60036b44ed682a19c91db7483c447ef7530dfdbd
4
+ data.tar.gz: 3de01e25124ed31b652458fa548c73602f200f8479bd10fa93cfdaf97826ffda
5
5
  SHA512:
6
- metadata.gz: 1a2f5df347e13c30678a52e77b2153414ab9df8bdc267fdd79032a4ce42d4ab1ef64199f570a223a5ec2d2c6adbd9c226f36fc0aa85335781af299e6c50c2af5
7
- data.tar.gz: 49ebb38e1bd0a0883e239abc224eea975c979570ef8cc7bae30783437027e28d173d328c90c7dc582044c5ce8c513ddaaf029bbf0aa128b7c34cdc39278ce17f
6
+ metadata.gz: 6599f826b2a0e1b5e400cab4cace8aa24e6cc055a2c24d977d7b399f1a56db22f4623b3291f53cf2aff6e672bdf918783cef1958c533041dd70d605593947c19
7
+ data.tar.gz: 8766458b663269de4ff7f8b4a85487346b2d2d332f748067dbd7dd227fd78549a3482342b96c40a113a8a1359948e25196c639dacfd611e1a30a3d2b647239cd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- open_api_smart_recruiters_sdk (0.2.2)
4
+ open_api_smart_recruiters_sdk (0.2.3)
5
5
  oauth2 (~> 2.0)
6
6
  typhoeus (~> 1.4)
7
7
 
@@ -17,9 +17,8 @@ module SmartRecruiters
17
17
 
18
18
  # Initializes the ApiClient
19
19
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
20
- def initialize(access_token, config = Configuration.default)
20
+ def initialize(config = Configuration.default)
21
21
  @config = config
22
- @config.access_token = access_token
23
22
  @user_agent = "SmartRecruiters/#{VERSION}/ruby"
24
23
  @default_headers = {
25
24
  'Content-Type' => 'application/json',
@@ -53,9 +53,19 @@ module SmartRecruiters
53
53
  }
54
54
  )
55
55
 
56
- token.refresh!({ client_id: config.client_id, client_secret: config.client_secret }) if token.expired?
56
+ if token.expired?
57
+ token.refresh!({ client_id: config.client_id, client_secret: config.client_secret })
58
+
59
+ load_token(token)
60
+ end
57
61
 
58
62
  token
59
63
  end
64
+
65
+ def load_token(token)
66
+ SmartRecruiters::Configuration.default.access_token = token.token
67
+ SmartRecruiters::Configuration.default.token_expires_at = token.expires_at
68
+ SmartRecruiters::Configuration.default.refresh_token = token.refresh_token
69
+ end
60
70
  end
61
71
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmartRecruiters
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_api_smart_recruiters_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - OneNeptune
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-21 00:00:00.000000000 Z
11
+ date: 2023-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2