lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb in adiwg-mdtranslator-2.10.0 vs lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb in adiwg-mdtranslator-2.12.0.pre
- old
+ new
@@ -1,11 +1,13 @@
# FGDC <<Class>> GeologicRange
# FGDC CSDGM writer output in XML
# History:
-# Stan Smith 2017-11-24 original script
+# Stan Smith 2018-03-19 refactored error and warning messaging
+# Stan Smith 2017-11-24 original script
+require_relative '../fgdc_writer'
require_relative 'class_geologicAge'
module ADIWG
module Mdtranslator
module Writers
@@ -14,10 +16,11 @@
class GeologicRange
def initialize(xml, hResponseObj)
@xml = xml
@hResponseObj = hResponseObj
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
end
def writeXML(hAgeStart, hAgeEnd)
# classes used
@@ -28,22 +31,20 @@
@xml.tag!('beggeol') do
ageClass.writeXML(hAgeStart)
end
end
if hAgeStart.empty?
- @hResponseObj[:writerPass] = false
- @hResponseObj[:writerMessages] << 'Geologic Age Range is missing starting age'
+ @NameSpace.issueWarning(172, nil)
end
# geologic age range (endgeol) - ending geologic age (required)
unless hAgeStart.empty?
@xml.tag!('endgeol') do
ageClass.writeXML(hAgeEnd)
end
end
if hAgeEnd.empty?
- @hResponseObj[:writerPass] = false
- @hResponseObj[:writerMessages] << 'Geologic Age Range is missing ending age'
+ @NameSpace.issueWarning(173, nil)
end
end # writeXML
end # GeologicAge