lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataInfo.rb in adiwg-mdtranslator-2.9.2 vs lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataInfo.rb in adiwg-mdtranslator-2.10.0
- old
+ new
@@ -1,9 +1,10 @@
# unpack metadata information
# Reader - ADIwg JSON to internal data structure
# History:
+# Stan Smith 2018-02-19 refactored error and warning messaging
# Stan Smith 2018-01-27 add metadataConstraints
# Stan Smith 2017-01-31 remove metadataCreationDate
# Stan Smith 2016-10-31 original script
require_relative 'module_identifier'
@@ -25,11 +26,11 @@
def self.unpack(hMetaInfo, responseObj)
# return nil object if input is empty
if hMetaInfo.empty?
- responseObj[:readerExecutionMessages] << 'MetadataInfo object is empty'
+ responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: metadata info object is empty'
responseObj[:readerExecutionPass] = false
return nil
end
# instance classes needed in script
@@ -89,11 +90,11 @@
intMetaInfo[:metadataContacts] << hReturn
end
end
end
if intMetaInfo[:metadataContacts].empty?
- responseObj[:readerExecutionMessages] << 'MetadataInfo object is missing metadataContacts'
+ responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: metadata info contact is missing'
responseObj[:readerExecutionPass] = false
return nil
end
# metadata information - metadata dates [] {date}
@@ -150,10 +151,10 @@
end
end
# metadata information - metadata status
if hMetaInfo.has_key?('metadataStatus')
- if hMetaInfo['metadataStatus'] != ''
+ unless hMetaInfo['metadataStatus'] == ''
intMetaInfo[:metadataStatus] = hMetaInfo['metadataStatus']
end
end
return intMetaInfo