learnworlds 0.1.0 → 0.1.1

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: dec047b90f49e77a404d68f80a7622c5421d0183d3cc2d8e95fda932ca6c7690
4
- data.tar.gz: 1861ccc8603b47775f8aac4ff1d7b49ae2b0fa201867c06a6e760d75b50e5095
3
+ metadata.gz: 326b7da781aae52fef008a7b6c28e38ac7df6bd5f7d3e7aaa63a2f49736e3422
4
+ data.tar.gz: 0d9967da29d5c941b8470d3d0baf4e2c3d6ed287314cd0faaa02afcd6113b795
5
5
  SHA512:
6
- metadata.gz: 04ee2d52a92ea6318e4eeb8c36ce25d340efe669f51fd54afb438ed833d6c90466689558a67a8241904fd4e70ff1689c67f34e7bcb76431392bfa9e86f9c35f1
7
- data.tar.gz: 875ab74e4416b3ab4e8304508eb70730e81f3456d4b178cda93d925966ffe513ba6c8a2381dc60e773c082641eb44e4ece45e84a7cc6c6226214358c9490bb3f
6
+ metadata.gz: d4136813e98e0ab31e54a4abe278f66d6cc63c0eb887913be7cd2948589d4ae740bcc9091d149e49ee945f6655323de3a4560e1f45c1e326a342d7a3d43dc932
7
+ data.tar.gz: af249f49f09b4c2d7d1dc476f9bc0dee42c55a795e6cac0ff0a5f8833106bdeb03c8f81ae5c15cdfe5c8ae8a24bd4d0b52ee87d28fdbdf5d6568796a7e0262f4
data/.rubocop.yml CHANGED
@@ -26,3 +26,6 @@ Lint/SymbolConversion:
26
26
 
27
27
  Layout/LineLength:
28
28
  Max: 120
29
+
30
+ Metrics/MethodLength:
31
+ Max: 12
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2022-06-29
4
+
5
+ - Add expires_in as parameter to persist_access_token_method
6
+
3
7
  ## [0.1.0] - 2022-06-29
4
8
 
5
9
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- learnworlds (0.1.0)
4
+ learnworlds (0.1.1)
5
5
  faraday (~> 2.3)
6
6
 
7
7
  GEM
@@ -6,7 +6,7 @@ require_relative "object"
6
6
  module LearnWorlds
7
7
  class Client
8
8
  attr_reader :base_url, :client_id, :client_secret
9
- attr_accessor :access_token
9
+ attr_accessor :access_token, :expires_in
10
10
 
11
11
  def initialize(client_id: nil, client_secret: nil, base_url: nil, access_token: nil)
12
12
  @client_id = client_id || ENV.fetch('"LEARN_WORLDS_CLIENT_ID"')
@@ -15,7 +15,7 @@ module LearnWorlds
15
15
  end
16
16
 
17
17
  # custom method to store the access token until it expires so we don't need to make uneccessary calls
18
- LearnWorlds.configuration.persist_access_token_method&.call(client.access_token)
18
+ LearnWorlds.configuration.persist_access_token_method&.call(client.access_token, client.expires_in)
19
19
  end
20
20
 
21
21
  # custom retrieve method can be used if you store the access token on your side until it expires for example
@@ -40,6 +40,7 @@ module LearnWorlds
40
40
  )
41
41
  response_body = Object.new(response.body)
42
42
  client.access_token = response_body.tokenData.access_token
43
+ client.expires_in = response_body.tokenData.expires_in
43
44
  end
44
45
  end
45
46
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LearnWorlds
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: learnworlds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nuno Correia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-01 00:00:00.000000000 Z
11
+ date: 2022-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday