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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -0
- data/lib/learn_worlds/objects/enrollment_object.rb +4 -0
- data/lib/learn_worlds/resources/user_resource.rb +5 -0
- data/lib/learn_worlds/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c23afd4a12db0a2206b6c516528aef1af8aa0c5d58d04b9a827016a1830148ca
|
4
|
+
data.tar.gz: aa74366632f4ed85f0f3b82bcbacd1012ab2a979df3cab27f6a94933dba2f3a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb7fb5be2fe32e95ba31aeaa5557a05599b609f87c269387ad8c94c4a7d1ebe800481f408ac7c9663472c419cf943eaa35d502ef6ef81bf8f7a81885b3a918e4
|
7
|
+
data.tar.gz: b65f875304f0d2d2ff5616e4e3e22855fd88be69a91eda6be4e0ad7e3cdcd754d3f106643b186a72464477108943b382d67fd5fc46e680170db222245d5d22c6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
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
|
|
@@ -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
|
data/lib/learn_worlds/version.rb
CHANGED
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.
|
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:
|
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
|