Class: MD_Format

Inherits:
Object
  • Object
show all
Defined in:
lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb

Overview

History: Stan Smith 2013-08-26 original script

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ MD_Format

Returns a new instance of MD_Format.



9
10
11
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb', line 9

def initialize(xml)
  @xml = xml
end

Instance Method Details

#writeXML(rFormat) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb', line 13

def writeXML(rFormat)

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

    # format - name - required
    s = rFormat[:formatName]
    if s.nil?
      @xml.tag!('gmd:name',{'gco:nilReason'=>'missing'})
    else
      @xml.tag!('gmd:name') do
        @xml.tag!('gco:CharacterString',s)
      end
    end

    # format - version - required
    s = rFormat[:formatVersion]
    if s.nil?
      @xml.tag!('gmd:version',{'gco:nilReason'=>'unknown'})
    else
      @xml.tag!('gmd:version') do
        @xml.tag!('gco:CharacterString',s)
      end
    end
  end

end