Sha256: 1a443af23e7fe8c4f624878f98f5d8f0de6a5f264f692a32354688974f0916d4

Contents?: true

Size: 1.53 KB

Versions: 6

Compression:

Stored size: 1.53 KB

Contents

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

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

module ADIWG
   module Mdtranslator
      module Writers
         module Fgdc

            class Description

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

               def writeXML(hResourceInfo)

                  # description 1.2.1 (abstract) - abstract (required)
                  # <- hResourceInfo[:abstract] (required)
                  unless hResourceInfo[:abstract].nil?
                     @xml.tag!('abstract', hResourceInfo[:abstract])
                  end

                  # description 1.2.2 (purpose) - purpose (required)
                  # <- hResourceInfo[:purpose] (required)
                  unless hResourceInfo[:purpose].nil?
                     @xml.tag!('purpose', hResourceInfo[:purpose])
                  end
                  if hResourceInfo[:purpose].nil?
                     @hResponseObj[:writerPass] = false
                     @hResponseObj[:writerMessages] << 'Description is missing purpose'
                  end

                  # description 1.2.3 (supplinf) - supplemental information
                  # <- hResourceInfo[:supplementalInfo]
                  unless hResourceInfo[:supplementalInfo].nil?
                     @xml.tag!('supplinf', hResourceInfo[:supplementalInfo])
                  end

               end # writeXML
            end # Description

         end
      end
   end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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