absorb_api 0.1.10 → 0.1.11
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 +4 -4
- data/Gemfile +1 -0
- data/lib/absorb_api/user.rb +21 -2
- data/lib/absorb_api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3eb2f3a9b826a7ecace98a90ee361669a68c6a5
|
4
|
+
data.tar.gz: 40de4863fd8c9b706c802d778fbf6763b25b5748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0200d4112113652248aa63b2b633bfac3860627afc44561c9715ac6c86ac355faa2cd4318f19071bae8b178ee78dc0c9f3a46943b9ac5619566951527962ac8d
|
7
|
+
data.tar.gz: 682411c891a5a79d2816a10c847fd0d300ca4dfb10a26af86b585d4abdc0921b8c70fda313bbbd747a4f8eb666b460481229ed0fe056345b2d44644624822816
|
data/Gemfile
CHANGED
data/lib/absorb_api/user.rb
CHANGED
@@ -2,16 +2,35 @@ module AbsorbApi
|
|
2
2
|
class User < Base
|
3
3
|
include Relations
|
4
4
|
|
5
|
-
attr_accessor :id, :department_id, :first_name, :middle_name, :last_name,
|
5
|
+
attr_accessor :id, :department_id, :first_name, :middle_name, :last_name,
|
6
|
+
:username, :password, :email_address, :cc_email_addresses,
|
7
|
+
:language_id, :gender, :address, :address2, :city,
|
8
|
+
:province_id, :country_id, :postal_code, :phone,
|
9
|
+
:employee_number, :location, :job_title, :reference_number,
|
10
|
+
:date_hired, :date_terminated, :notes, :custom_fields,
|
11
|
+
:role_ids, :active_status, :is_learner, :is_admin,
|
12
|
+
:is_instructor, :external_id, :supervisor_id, :decimal2,
|
13
|
+
:string1, :decimal1, :string2, :decimal3, :job_title
|
6
14
|
|
7
15
|
has_many :courses
|
8
16
|
has_many :enrollments, klass: :course_enrollment
|
9
17
|
has_many :certificates
|
10
18
|
has_many :resources
|
11
19
|
|
20
|
+
def update(attrs)
|
21
|
+
attrs.keys.each { |k| attrs[k.to_s.camelize] = attrs.delete(k) }
|
22
|
+
attrs['Username'] = username
|
23
|
+
|
24
|
+
response = AbsorbApi.api.put("users/#{id}", attrs)
|
25
|
+
raise ValidationError if response.status == 500
|
26
|
+
raise RouteNotFound if response.status == 405
|
27
|
+
|
28
|
+
self
|
29
|
+
end
|
30
|
+
|
12
31
|
# gets all associated courses given a collection of users
|
13
32
|
# all calls are called in parallel
|
14
|
-
# users are chunked in groups of 105 to keep typhoeus from
|
33
|
+
# users are chunked in groups of 105 to keep typhoeus from bogging down
|
15
34
|
def self.courses_from_collection(users)
|
16
35
|
courses = []
|
17
36
|
users.each_slice(105) do |user_slice|
|
data/lib/absorb_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: absorb_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- npezza
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -177,3 +177,4 @@ signing_key:
|
|
177
177
|
specification_version: 4
|
178
178
|
summary: API wrapper for Absorb LMS
|
179
179
|
test_files: []
|
180
|
+
has_rdoc:
|