elibri_onix_generator 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/elibri_onix_generator.rb +26 -1
- data/lib/elibri_onix_generator/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: 71115f37bcde9eda5eebb3b355c90fc81753edf7
|
4
|
+
data.tar.gz: f45550badba24f0d037cf30bb601582e63e7e51a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ea02de5f3868a36a6bad48d85f7d8bd059a676e9e0c7fcc6ee9d6826be853366587ad7414cacfacf9a96645b0cf43f9030bd03df5828b5be26b35eeed66918e
|
7
|
+
data.tar.gz: d1784ced28c754a6b9cd217306f742f5727fa46f927f63e974e5d849687d4617dff85af73668bd79f49538c4d9290a896a9d8d85269f9e5b00494e32a493a3bf
|
@@ -165,7 +165,12 @@ module Elibri
|
|
165
165
|
end
|
166
166
|
|
167
167
|
def field_exists?(object, method_name)
|
168
|
-
object.respond_to?(method_name)
|
168
|
+
if object.respond_to?(method_name)
|
169
|
+
v = object.send(method_name)
|
170
|
+
v && (v.respond_to?(:size) ? v.size > 0 : true)
|
171
|
+
else
|
172
|
+
false
|
173
|
+
end
|
169
174
|
end
|
170
175
|
|
171
176
|
|
@@ -678,6 +683,26 @@ module Elibri
|
|
678
683
|
end
|
679
684
|
end
|
680
685
|
|
686
|
+
if product.respond_to?(:thema_codes_for_onix)
|
687
|
+
product.thema_codes_for_onix.each do |code|
|
688
|
+
|
689
|
+
scheme_id = {
|
690
|
+
"1" => 94, #Thema place qualifier
|
691
|
+
"2" => 95, #Thema language qualifier
|
692
|
+
"3" => 96, #Thema time period qualifier
|
693
|
+
"4" => 97, #Thema educational purpose qualifier
|
694
|
+
"5" => 98, #Thema interest age / special interest qualifier
|
695
|
+
"6" => 99, #Thema style qualifier
|
696
|
+
}[code[0]] || 93
|
697
|
+
|
698
|
+
tag(:Subject) do
|
699
|
+
tag(:SubjectSchemeIdentifier, scheme_id)
|
700
|
+
tag(:SubjectSchemeVersion, "1.3")
|
701
|
+
tag(:SubjectCode, code)
|
702
|
+
end
|
703
|
+
end
|
704
|
+
end
|
705
|
+
|
681
706
|
# Kategorie wg. wydawnictwa
|
682
707
|
if product.respond_to?(:publisher_product_categories)
|
683
708
|
product.publisher_product_categories.each do |product_category|
|