class ADIWG::Mdtranslator::Writers::Iso19115_2::MD_BrowseGraphic

Public Class Methods

new(xml, hResponseObj) click to toggle source
# File lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb, line 22
def initialize(xml, hResponseObj)
   @xml = xml
   @hResponseObj = hResponseObj
   @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
end

Public Instance Methods

writeXML(hGraphic, inContext = nil) click to toggle source
# File lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb, line 28
def writeXML(hGraphic, inContext = nil)

   @xml.tag!('gmd:MD_BrowseGraphic') do

      # browse graphic - file name (required)
      s = hGraphic[:graphicName]
      unless s.nil?
         @xml.tag!('gmd:fileName') do
            @xml.tag!('gco:CharacterString', s)
         end
      end
      if s.nil?
         @NameSpace.issueWarning(20, 'gmd:fileName', inContext)
      end

      # browse graphic - file description
      s = hGraphic[:graphicDescription]
      unless s.nil?
         @xml.tag!('gmd:fileDescription') do
            @xml.tag!('gco:CharacterString', s)
         end
      end
      if s.nil? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:fileDescription')
      end

      # browse graphic - file type
      s = hGraphic[:graphicType]
      unless s.nil?
         @xml.tag!('gmd:fileType') do
            @xml.tag!('gco:CharacterString', s)
         end
      end
      if s.nil? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:fileType')
      end

   end # MD_BrowseGraphic tag
end