lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb in adiwg-mdtranslator-2.12.0 vs lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb in adiwg-mdtranslator-2.13.0

- old
+ new

@@ -1,8 +1,9 @@ # Writer - internal data structure to ISO 19110:2003 # History: +# Stan Smith 2018-03-30 add error/warning/notice message methods # Stan Smith 2017-05-26 allow choice of which dictionary to translate # ... fix bug when no dictionary is provided in mdJson # Stan Smith 2017-01-20 refactor for mdJson/mdTranslator 2.0 # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes @@ -18,11 +19,11 @@ module ADIWG module Mdtranslator module Writers module Iso19110 - def self.startWriter(intObj, responseObj, whichDict: 0) + def self.startWriter(intObj, hResponseObj, whichDict: 0) # Iso19110 can only output one dictionary at a time # test if requested dictionary is in input file if intObj[:dataDictionaries][whichDict].nil? responseObj[:writerMessages] << 'Dictionary is missing' @@ -31,27 +32,27 @@ end # make objects available to the instance @intObj = intObj @contacts = intObj[:contacts] - @hResponseObj = responseObj + @hResponseObj = hResponseObj dictionary = intObj[:dataDictionaries][whichDict] @domains = dictionary[:domains] # load error message array file = File.join(File.dirname(__FILE__), 'iso19110_writer_messages_eng') + '.yml' hMessageList = YAML.load_file(file) @aMessagesList = hMessageList['messageList'] # set the format of the output file based on the writer specified - responseObj[:writerOutputFormat] = 'xml' - responseObj[:writerVersion] = ADIWG::Mdtranslator::Writers::Iso19110::VERSION + hResponseObj[:writerOutputFormat] = 'xml' + hResponseObj[:writerVersion] = ADIWG::Mdtranslator::Writers::Iso19110::VERSION # create new XML document @xml = Builder::XmlMarkup.new(indent: 3) # start writing the ISO 19110 XML record - metadataWriter = FC_FeatureCatalogue.new(@xml, responseObj) + metadataWriter = FC_FeatureCatalogue.new(@xml, hResponseObj) metadata = metadataWriter.writeXML(intObj) return metadata end