Class: GenericMetaData

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

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ GenericMetaData

Returns a new instance of GenericMetaData.



20
21
22
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_genericMetaData.rb', line 20

def initialize(xml)
  @xml = xml
end

Instance Method Details

#writeXML(aTempExt) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_genericMetaData.rb', line 24

def writeXML(aTempExt)

  # classes used
  timeIClass = TimeInstant.new(@xml)
  timePClass = TimePeriod.new(@xml)

  @xml.tag!('gml:GenericMetaData') do

    aTempExt.each do |hTempExt|

      # metadata - data
      hTimeD = hTempExt[:date]
      unless hTimeD.empty?
        date = hTimeD[:dateTime]
        dateResolution = hTimeD[:dateResolution]
        s = AdiwgDateTimeFun.stringDateFromDateTime(date, dateResolution)
        if s != 'ERROR'
          @xml.tag!('gco:Date', s)
        end
      end

      # metadata - time instant
      hTimeI = hTempExt[:timeInstant]
      unless hTimeI.empty?
        timeIClass.writeXML(hTimeI)
      end

      # metadata - time period
      hTimeP = hTempExt[:timePeriod]
      unless hTimeP.empty?
        timePClass.writeXML(hTimeP)
      end

    end

  end

end