relaton-bib 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_bib/hash_converter.rb +4 -3
- data/lib/relaton_bib/localized_string.rb +5 -4
- data/lib/relaton_bib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 159e7430eaae042b7130807811e748afeede73d727c865d06a3acedd03e5de08
|
4
|
+
data.tar.gz: 69c3efa7687a851d14aee6a22878b4359928eb692371313384f4332bd1dee068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02bc4eceac45f0e63be85121b73a68db0c66625b917d108a5ebde58a6e975373a0e95f9e2b30a056f1551de18357cfeb49c89804758385cbf5e324513fe6037c
|
7
|
+
data.tar.gz: b2cebd03f70db311a4839c4543f02d2011dbed485d79c7823023dd088381424fc9070bf885cd5232d8eef6841c8d8fdd7cb434d61ba93b9c8457635684cbc601
|
@@ -207,6 +207,7 @@ module RelatonBib
|
|
207
207
|
org[:subdivision] = array(org[:subdivision]).map do |sd|
|
208
208
|
LocalizedString.new sd
|
209
209
|
end
|
210
|
+
org[:contact] = contacts_hash_to_bib(org)
|
210
211
|
org
|
211
212
|
end
|
212
213
|
|
@@ -256,10 +257,10 @@ module RelatonBib
|
|
256
257
|
end
|
257
258
|
end
|
258
259
|
|
259
|
-
def contacts_hash_to_bib(
|
260
|
-
return [] unless
|
260
|
+
def contacts_hash_to_bib(entity) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
261
|
+
return [] unless entity[:contact]
|
261
262
|
|
262
|
-
array(
|
263
|
+
array(entity[:contact]).map do |a|
|
263
264
|
if a[:city] || a[:country]
|
264
265
|
RelatonBib::Address.new(
|
265
266
|
street: Array(a[:street]), city: a[:city], postcode: a[:postcode],
|
@@ -21,14 +21,15 @@ module RelatonBib
|
|
21
21
|
if content.is_a?(Array) && content.none?
|
22
22
|
raise ArgumentError, "LocalizedString content is empty"
|
23
23
|
end
|
24
|
+
|
24
25
|
@language = language.is_a?(String) ? [language] : language
|
25
26
|
@script = script.is_a?(String) ? [script] : script
|
26
27
|
@content = if content.is_a?(Array)
|
27
28
|
content.map do |c|
|
28
|
-
|
29
|
+
case c
|
30
|
+
when Hash
|
29
31
|
LocalizedString.new c[:content], c[:language], c[:script]
|
30
|
-
|
31
|
-
LocalizedString.new c
|
32
|
+
when String then LocalizedString.new c
|
32
33
|
else c
|
33
34
|
end
|
34
35
|
end
|
@@ -38,7 +39,7 @@ module RelatonBib
|
|
38
39
|
|
39
40
|
# @return [String]
|
40
41
|
def to_s
|
41
|
-
content.is_a?(
|
42
|
+
content.is_a?(Array) ? content.first.to_s : content.to_s
|
42
43
|
end
|
43
44
|
|
44
45
|
# @return [TrueClass, FalseClass]
|
data/lib/relaton_bib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|