Sha256: 44b229ffcefd5bc577e38ff1da63612d9d28f997835c0d3bd17090e7cc5c5c6a

Contents?: true

Size: 1.59 KB

Versions: 7

Compression:

Stored size: 1.59 KB

Contents

# FGDC <<Class>> GeologicRange
# FGDC CSDGM writer output in XML

# History:
#   Stan Smith 2017-11-24 original script

require_relative 'class_geologicAge'

module ADIWG
   module Mdtranslator
      module Writers
         module Fgdc

            class GeologicRange

               def initialize(xml, hResponseObj)
                  @xml = xml
                  @hResponseObj = hResponseObj
               end

               def writeXML(hAgeStart, hAgeEnd)

                  # classes used
                  ageClass = GeologicAge.new(@xml, @hResponseObj)

                  # geologic age range (beggeol) - starting geologic age (required)
                  unless hAgeStart.empty?
                     @xml.tag!('beggeol') do
                        ageClass.writeXML(hAgeStart)
                     end
                  end
                  if hAgeStart.empty?
                     @hResponseObj[:writerPass] = false
                     @hResponseObj[:writerMessages] << 'Geologic Age Range is missing starting age'
                  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'
                  end

               end # writeXML
            end # GeologicAge

         end
      end
   end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.10.0 lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb
adiwg-mdtranslator-2.9.2 lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb
adiwg-mdtranslator-2.9.1 lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb
adiwg-mdtranslator-2.9.0 lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb
adiwg-mdtranslator-2.8.0 lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb
adiwg-mdtranslator-2.7.0 lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb
adiwg-mdtranslator-2.6.1 lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb