alma 0.5.1 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alma/availability_response.rb +15 -7
- data/lib/alma/response.rb +14 -2
- data/lib/alma/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e09da26db9596cc2e8a1471efd1f75f6c8e29264860614ae7ca5a3b79567b2c0
|
4
|
+
data.tar.gz: 808d2a2f12fa77077e030f8c5b2bb8f072fdbe69f2f775b24be36e7de16fb285
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcbad60834c1231169c93ee6b37fc458085e6deafbc9bb8c9064cc8e9ac0cbccc40edf569d912f22232bbe436f9f4386430011e6c865d250f2b02194cd529cc8
|
7
|
+
data.tar.gz: f8a8d01ab65472572fa263a1549c10af53638c83a934501c05faca5310c747873c3c1ba33b4d9c7190f3f752959686d58d7ca572f1c4e42c2d8f1ed4110c685e
|
@@ -20,22 +20,30 @@ module Alma
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def build_holdings_for(bib)
|
23
|
+
holdings = []
|
24
|
+
|
23
25
|
get_inventory_fields_for(bib).map do |inventory_field|
|
26
|
+
h = {}
|
27
|
+
|
24
28
|
# Use the mapping for this inventory type
|
25
29
|
subfield_codes = Alma::INVENTORY_SUBFIELD_MAPPING[inventory_field["tag"]]
|
30
|
+
h["inventory_type"] = subfield_codes["INVENTORY_TYPE"]
|
26
31
|
|
27
32
|
inventory_field.
|
28
33
|
# Get all the subfields for this inventory field
|
29
34
|
fetch("subfield", []).
|
30
35
|
# Limit to only subfields codes for which we have a mapping
|
31
|
-
select { |sf| subfield_codes.key? sf["code"] }.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
36
|
+
select { |sf| subfield_codes.key? sf["code"] }.each { |f|
|
37
|
+
key = subfield_codes[f["code"]]
|
38
|
+
if h.key? key
|
39
|
+
h[key] << " " + f["content"]
|
40
|
+
else
|
41
|
+
h[key] = f["content"]
|
42
|
+
end
|
43
|
+
}
|
44
|
+
holdings << h
|
38
45
|
end
|
46
|
+
holdings
|
39
47
|
end
|
40
48
|
|
41
49
|
def get_inventory_fields_for(bib)
|
data/lib/alma/response.rb
CHANGED
@@ -14,7 +14,7 @@ module Alma
|
|
14
14
|
|
15
15
|
def initialize(response)
|
16
16
|
@raw_response = response
|
17
|
-
|
17
|
+
@response = response.parsed_response
|
18
18
|
validate(response)
|
19
19
|
end
|
20
20
|
|
@@ -37,9 +37,21 @@ module Alma
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
def request_id
|
41
|
+
@response.fetch("request_id", "")
|
42
|
+
end
|
43
|
+
|
44
|
+
def managed_by_library
|
45
|
+
@response.fetch("managed_by_library", "")
|
46
|
+
end
|
47
|
+
|
48
|
+
def managed_by_library_code
|
49
|
+
@response.fetch("managed_by_library_code", "")
|
50
|
+
end
|
51
|
+
|
40
52
|
# Returns an array of errors
|
41
53
|
def errors
|
42
|
-
@
|
54
|
+
@response&.dig("errorList", "error") || []
|
43
55
|
end
|
44
56
|
end
|
45
57
|
end
|
data/lib/alma/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jennifer Anton
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-
|
13
|
+
date: 2024-09-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
280
280
|
- !ruby/object:Gem::Version
|
281
281
|
version: '0'
|
282
282
|
requirements: []
|
283
|
-
rubygems_version: 3.5.
|
283
|
+
rubygems_version: 3.5.11
|
284
284
|
signing_key:
|
285
285
|
specification_version: 4
|
286
286
|
summary: Client for Ex Libris Alma Web Services
|