alma 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 +4 -4
- data/README.md +5 -1
- data/lib/alma/renewal_response.rb +1 -1
- data/lib/alma/result_set.rb +3 -2
- data/lib/alma/user.rb +30 -3
- data/lib/alma/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a61f0bfe79181cdb4d99e0eca51ba16b1be6550f
|
4
|
+
data.tar.gz: 8f024c368175b3a8ac0fe2e6eb836f436516a566
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58b8bcfbe9b5c4f6ccd688df845bfb86e3fe8115199b06862c03b6faeaf31e08e4f9a33cca5209c082fa69f8416461dc9c45bef34a9c57179a48d4f29f7b2397
|
7
|
+
data.tar.gz: 60e8ea0221d2dce2001e53afd41d0f046cb822e56c74f2e07ecffcacc7fa9e94ce9c4730572f79cd0463d12c09506e64a4af9b52ed871cefa2be625a650e6cbb
|
data/README.md
CHANGED
@@ -80,6 +80,8 @@ Now you can access those configuration attributes with `Alma.configuration.apike
|
|
80
80
|
|
81
81
|
```
|
82
82
|
|
83
|
+
Each fine object reflects the available fields in the returned XML,[as documented on the Ex Libris Api docs](https://developers.exlibrisgroup.com/alma/apis/xsd/rest_fees.xsd?tags=GET)
|
84
|
+
|
83
85
|
#### Get details on a users loans
|
84
86
|
|
85
87
|
```ruby
|
@@ -101,6 +103,7 @@ loans.list.first.due_date
|
|
101
103
|
"2016-12-26z
|
102
104
|
|
103
105
|
```
|
106
|
+
Each loan object reflects the available fields in the returned XML,[as documented on the Ex Libris Api docs](https://developers.exlibrisgroup.com/alma/apis/xsd/rest_item_loans.xsd?tags=GET)
|
104
107
|
|
105
108
|
To renew an item you can can call the Loan objects renew method
|
106
109
|
|
@@ -137,7 +140,8 @@ requests.list.first.request_status
|
|
137
140
|
> "In Process"
|
138
141
|
|
139
142
|
```
|
140
|
-
|
143
|
+
Each request object reflects the available fields in the returned XML,[as documented on the Ex Libris Api docs](https://developers.exlibrisgroup.com/alma/apis/xsd/rest_user_requests.xsd?tags=GET)
|
144
|
+
|
141
145
|
Loans, fines and Requests can also be accessed statically
|
142
146
|
|
143
147
|
```ruby
|
data/lib/alma/result_set.rb
CHANGED
@@ -2,9 +2,10 @@ module Alma
|
|
2
2
|
class ResultSet
|
3
3
|
extend Forwardable
|
4
4
|
|
5
|
+
include Enumerable
|
5
6
|
include Alma::Error
|
6
7
|
|
7
|
-
def_delegators :list, :
|
8
|
+
def_delegators :list, :each, :size
|
8
9
|
|
9
10
|
def initialize(ws_response)
|
10
11
|
@response = ws_response
|
@@ -46,4 +47,4 @@ module Alma
|
|
46
47
|
end
|
47
48
|
end
|
48
49
|
end
|
49
|
-
end
|
50
|
+
end
|
data/lib/alma/user.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
module Alma
|
4
2
|
class User < AlmaRecord
|
5
3
|
extend Alma::Api
|
@@ -25,10 +23,20 @@ module Alma
|
|
25
23
|
|
26
24
|
def renew_loan(loan_id)
|
27
25
|
response = self.class.renew_loan({user_id: self.id, loan_id: loan_id})
|
28
|
-
|
26
|
+
if response.renewed?
|
27
|
+
@recheck_loans ||= true
|
28
|
+
end
|
29
29
|
response
|
30
30
|
end
|
31
31
|
|
32
|
+
def renew_multiple_loans(loan_ids)
|
33
|
+
loan_ids.map { |id| renew_loan(id) }
|
34
|
+
end
|
35
|
+
|
36
|
+
def renew_all_loans
|
37
|
+
renew_multiple_loans(loans.map(&:loan_id))
|
38
|
+
end
|
39
|
+
|
32
40
|
def recheck_loans?
|
33
41
|
@recheck_loans
|
34
42
|
end
|
@@ -105,6 +113,25 @@ module Alma
|
|
105
113
|
RenewalResponse.new(response)
|
106
114
|
end
|
107
115
|
|
116
|
+
# Attempts to renew a multiple items for a user
|
117
|
+
# @param [Hash] args
|
118
|
+
# @option args [String] :user_id The unique id of the user
|
119
|
+
# @option args [Array<String>] :loan_ids Array of loan ids
|
120
|
+
# @option args [String] :user_id_type Type of identifier being used to search. OPTIONAL
|
121
|
+
# @return [Array<RenewalResponse>] Object indicating the renewal message
|
122
|
+
def renew_multiple_loans(args)
|
123
|
+
|
124
|
+
if args.fetch(:loans_ids, nil).respond_to? :map
|
125
|
+
args.delete(:loan_ids).map do |loan_id|
|
126
|
+
renew_loan(args.merge(loan_id: loan_id))
|
127
|
+
end
|
128
|
+
else
|
129
|
+
[]
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
|
108
135
|
|
109
136
|
def set_wadl_filename
|
110
137
|
'user.wadl'
|
data/lib/alma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Nelson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ezwadl
|