learnworlds 0.2.2 → 0.2.3

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: 350cb9098ffa9460535ace6d8c8c29988a5a924239c1ab654a682e6a9801f0e4
4
- data.tar.gz: f5ba89153ac72c241790d9bab9691c5cb182ee3c92d03dccdb16c1062410192c
3
+ metadata.gz: c23afd4a12db0a2206b6c516528aef1af8aa0c5d58d04b9a827016a1830148ca
4
+ data.tar.gz: aa74366632f4ed85f0f3b82bcbacd1012ab2a979df3cab27f6a94933dba2f3a0
5
5
  SHA512:
6
- metadata.gz: 71a724e288972dae917f0a1a2ce7e70fe2d83367d19a749a456f54a5a9991015f5ab307a50b26e9f225cfdc18a23ee54c9134573fa3cc1efd045592dbca100d8
7
- data.tar.gz: 6f425e3d59b69b148479a2bc21e286000d83ea48d08bcb13a5fa5550b108ca58483367f4e2b484990c8f591a5e41f5da988a567df87ff3719c8004db9db6ef87
6
+ metadata.gz: cb7fb5be2fe32e95ba31aeaa5557a05599b609f87c269387ad8c94c4a7d1ebe800481f408ac7c9663472c419cf943eaa35d502ef6ef81bf8f7a81885b3a918e4
7
+ data.tar.gz: b65f875304f0d2d2ff5616e4e3e22855fd88be69a91eda6be4e0ad7e3cdcd754d3f106643b186a72464477108943b382d67fd5fc46e680170db222245d5d22c6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.3] - 2022-08-09
4
+
5
+ - Add enrollments to user
6
+
3
7
  ## [0.2.2] - 2022-08-09
4
8
 
5
9
  - Add possibility to sso with user id instead of email
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- learnworlds (0.2.2)
4
+ learnworlds (0.2.3)
5
5
  faraday (~> 2.3)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -80,6 +80,9 @@ client.user.update(user_id: 'user_id', username: 'updated_username')
80
80
  # finds a user
81
81
  client.user.find(user_id: 'user_id')
82
82
 
83
+ # returns a list of enrollnments for a specific user
84
+ client.user.enrollments(user_id: 'user_id')
85
+
83
86
  # enrolls a user on a course
84
87
  client.user.enroll(user_id: 'user_id', product_id: 'course_id', product_type: 'course', price: 0)
85
88
 
@@ -0,0 +1,4 @@
1
+ module LearnWorlds
2
+ class EnrollmentObject < Object
3
+ end
4
+ end
@@ -15,6 +15,11 @@ module LearnWorlds
15
15
  UserObject.new(get_request("#{ENDPOINT}/#{user_id}").body)
16
16
  end
17
17
 
18
+ def enrollments(user_id:)
19
+ response = get_request("#{ENDPOINT}/#{user_id}/courses")
20
+ Collection.from_response(response, key: "data", type: EnrollmentObject)
21
+ end
22
+
18
23
  def update(user_id:, **params)
19
24
  put_request("#{ENDPOINT}/#{user_id}", params)
20
25
  true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LearnWorlds
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
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.2.2
4
+ version: 0.2.3
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-11-10 00:00:00.000000000 Z
11
+ date: 2023-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -46,6 +46,7 @@ files:
46
46
  - lib/learn_worlds/configuration.rb
47
47
  - lib/learn_worlds/learn_worlds_error.rb
48
48
  - lib/learn_worlds/object.rb
49
+ - lib/learn_worlds/objects/enrollment_object.rb
49
50
  - lib/learn_worlds/objects/user_object.rb
50
51
  - lib/learn_worlds/resource.rb
51
52
  - lib/learn_worlds/resources/authentication_resource.rb