rapa 0.5.0 → 0.5.1
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/CHANGELOG.md +9 -0
- data/lib/rapa/resources/item_resource.rb +57 -29
- data/lib/rapa/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5b7038a1d2e0b226439d25014351907abaef445
|
4
|
+
data.tar.gz: f01f0f430853d80866438add0bf6169460f70774
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 313c277bd07d18f745505fc190e28bc2ebaaba6f10f00cc47599d91ebb3733a80d47e0c9310f0a1bce2ba3907c05d5a2577e094492bd86bc8a2487a10f436dec
|
7
|
+
data.tar.gz: 67685e16f114e00f536af1028d72c1b53ef88c7b11c42dcf0c31d188723437d1e5cd63832bd9dd11be847cac2f53fa51616f77237b95906b9ea34efb9ee271cd
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## v0.5.1
|
2
|
+
|
3
|
+
- Fix `Rapa::Resources::ItemResource#alternate_versions` type
|
4
|
+
- Fix `Rapa::Resources::ItemResource#authors` type
|
5
|
+
- Fix `Rapa::Resources::ItemResource#browse_nodes` type
|
6
|
+
- Fix `Rapa::Resources::ItemResource#languages` type
|
7
|
+
- Fix `Rapa::Resources::ItemResource#related_items` type
|
8
|
+
- Fix `Rapa::Resources::ItemResource#similar_products` type
|
9
|
+
|
1
10
|
## v0.5.0
|
2
11
|
|
3
12
|
- Change `Rapa::Resources::ItemResource#browse_nodes` returned value type
|
@@ -10,12 +10,17 @@ module Rapa
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
# @return [Array<Rapa::AlternateVersion
|
13
|
+
# @return [Array<Rapa::AlternateVersion>]
|
14
14
|
def alternate_versions
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
case alternate_version_source_or_sources = source.dig("AlternateVersions", "AlternateVersion")
|
16
|
+
when ::Array
|
17
|
+
alternate_version_source_or_sources
|
18
|
+
when ::Hash
|
19
|
+
[alternate_version_source_or_sources]
|
20
|
+
else
|
21
|
+
[]
|
22
|
+
end.map do |alternate_version_source|
|
23
|
+
::Rapa::AlternateVersion.new(alternate_version_source)
|
19
24
|
end
|
20
25
|
end
|
21
26
|
|
@@ -24,10 +29,15 @@ module Rapa
|
|
24
29
|
source["ASIN"]
|
25
30
|
end
|
26
31
|
|
27
|
-
# @return [Array<String
|
32
|
+
# @return [Array<String>]
|
28
33
|
def authors
|
29
|
-
|
30
|
-
|
34
|
+
case author_source_or_sources = source.dig("ItemAttributes", "Author")
|
35
|
+
when ::Array
|
36
|
+
author_source_or_sources
|
37
|
+
when ::String
|
38
|
+
[author_source_or_sources]
|
39
|
+
else
|
40
|
+
[]
|
31
41
|
end
|
32
42
|
end
|
33
43
|
|
@@ -36,9 +46,16 @@ module Rapa
|
|
36
46
|
source.dig("ItemAttributes", "Binding")
|
37
47
|
end
|
38
48
|
|
39
|
-
# @return [Array
|
49
|
+
# @return [Array<Rapa::BrowseNode>]
|
40
50
|
def browse_nodes
|
41
|
-
source.dig("BrowseNodes", "BrowseNode")
|
51
|
+
case browse_node_source_or_sources = source.dig("BrowseNodes", "BrowseNode")
|
52
|
+
when ::Array
|
53
|
+
browse_node_source_or_sources
|
54
|
+
when ::Hash
|
55
|
+
[browse_node_source_or_sources]
|
56
|
+
else
|
57
|
+
[]
|
58
|
+
end.map do |browse_node_source|
|
42
59
|
::Rapa::BrowseNode.new(browse_node_source)
|
43
60
|
end
|
44
61
|
end
|
@@ -146,12 +163,17 @@ module Rapa
|
|
146
163
|
source.dig("ItemAttributes", "Label")
|
147
164
|
end
|
148
165
|
|
149
|
-
# @return [Array<Rapa::Language
|
166
|
+
# @return [Array<Rapa::Language>]
|
150
167
|
def languages
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
168
|
+
case language_source_or_sources = source.dig("ItemAttributes", "Languages", "Language")
|
169
|
+
when ::Array
|
170
|
+
language_source_or_sources
|
171
|
+
when ::Hash
|
172
|
+
[language_source_or_sources]
|
173
|
+
else
|
174
|
+
[]
|
175
|
+
end.map do |language_source|
|
176
|
+
::Rapa::Language.new(language_source)
|
155
177
|
end
|
156
178
|
end
|
157
179
|
|
@@ -238,16 +260,17 @@ module Rapa
|
|
238
260
|
end
|
239
261
|
end
|
240
262
|
|
241
|
-
# @return [Array<Rapa::Resources::ItemResource
|
263
|
+
# @return [Array<Rapa::Resources::ItemResource>]
|
242
264
|
def related_items
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
265
|
+
case item_source_or_sources = source.dig("RelatedItems", "RelatedItem")
|
266
|
+
when ::Array
|
267
|
+
item_source_or_sources
|
268
|
+
when ::Hash
|
269
|
+
[item_source_or_sources]
|
270
|
+
else
|
271
|
+
[]
|
272
|
+
end.map do |related_item_source|
|
273
|
+
::Rapa::Resources::ItemResource.new(related_item_source["Item"])
|
251
274
|
end
|
252
275
|
end
|
253
276
|
|
@@ -287,12 +310,17 @@ module Rapa
|
|
287
310
|
end
|
288
311
|
end
|
289
312
|
|
290
|
-
# @return [Array<Rapa::SimilarProduct
|
313
|
+
# @return [Array<Rapa::SimilarProduct>]
|
291
314
|
def similar_products
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
315
|
+
case similar_product_source_or_sources = source["SimilarProducts"]
|
316
|
+
when ::Array
|
317
|
+
similar_product_sources
|
318
|
+
when ::Hash
|
319
|
+
[similar_product_source_or_sources]
|
320
|
+
else
|
321
|
+
[]
|
322
|
+
end.map do |similar_product_source|
|
323
|
+
::Rapa::SimilarProduct.new(similar_product_source)
|
296
324
|
end
|
297
325
|
end
|
298
326
|
|
data/lib/rapa/version.rb
CHANGED