contentdm_api 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/lib/contentdm_api/item.rb +10 -5
- data/lib/contentdm_api/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24c59f2f7942f61ea5480a1b3bf726597f77da2bce1c1b4b6a1c80f056bd59ea
|
4
|
+
data.tar.gz: 94c7be93dce8be2ba5cf58df8cfbc4cdd5bb54ddaf4d786a9d62c011dc39ffe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b2e05d1138f8abfb375713d5a458a14749af227d724485557c8fad8ab87b3fd8920d4acdb1b479836f4a235773fd00a1656c15984ebf5d3ca2613e4ca18df78
|
7
|
+
data.tar.gz: 6403f5df1d27b714e3c51ce00deaa196f986ec0bd8faf2efebaf20d06f43bec0285451a22855b02bdd65fea2c546f6f45de5a097fbbfad740b5c6ad507dd6df9
|
data/.travis.yml
CHANGED
data/lib/contentdm_api/item.rb
CHANGED
@@ -15,7 +15,10 @@ module CONTENTdmAPI
|
|
15
15
|
# @param [String] collection The CONTENTdm API calls this an "alias"
|
16
16
|
# @param [Integer] id The CONTENTdm API calls this a "pointer". It is the
|
17
17
|
# identifier for a a given CONTENTdm item.
|
18
|
-
# @param [Boolean] with_compound
|
18
|
+
# @param [Boolean] with_compound Recursively request and in clude full
|
19
|
+
# compound item data? If false, basic compound data will STILL be
|
20
|
+
# included in the array value of the item hash key 'page'. 'page' is the
|
21
|
+
# term CONTENTdm uses to signify a list of child pages for an item.
|
19
22
|
# @param [Boolean] enrich_compount Fetch and merge full item info for each
|
20
23
|
# compound?
|
21
24
|
# @param [Object] requester A class to make requests of the API.
|
@@ -44,12 +47,12 @@ module CONTENTdmAPI
|
|
44
47
|
if with_compound
|
45
48
|
result_with_id.merge('page' => compounds_to_h)
|
46
49
|
else
|
47
|
-
result_with_id.merge('page' =>
|
50
|
+
result_with_id.merge('page' => page)
|
48
51
|
end
|
49
52
|
end
|
50
53
|
|
51
54
|
def compounds_to_h
|
52
|
-
|
55
|
+
page.map do |compound|
|
53
56
|
block_given? ? yield(compound(compound)) : compound(compound)
|
54
57
|
end
|
55
58
|
end
|
@@ -66,7 +69,9 @@ module CONTENTdmAPI
|
|
66
69
|
end
|
67
70
|
|
68
71
|
def page
|
69
|
-
result.
|
72
|
+
# Single result pages come back as a hash. Cast them into and array to
|
73
|
+
# make our api more consistent
|
74
|
+
[result.fetch('page', [])].flatten
|
70
75
|
end
|
71
76
|
|
72
77
|
def result_with_id
|
@@ -94,7 +99,7 @@ module CONTENTdmAPI
|
|
94
99
|
end
|
95
100
|
|
96
101
|
def service_configs
|
97
|
-
|
102
|
+
item_config.concat(compound_config)
|
98
103
|
end
|
99
104
|
|
100
105
|
def item_config
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentdm_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Fennell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -124,8 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
|
-
|
128
|
-
rubygems_version: 2.7.8
|
127
|
+
rubygems_version: 3.0.1
|
129
128
|
signing_key:
|
130
129
|
specification_version: 4
|
131
130
|
summary: Ruby bindings for the CONTENTdm API
|