Class: ADIWG::Mdtranslator::Writers::Iso19110::DerivedUnit

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

Instance Method Summary collapse

Constructor Details

#initialize(xml, responseObj) ⇒ DerivedUnit



18
19
20
21
# File 'lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb', line 18

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

Instance Method Details

#writeXML(hDerived) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb', line 23

def writeXML(hDerived)

   # create and identity for the unit
   @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
   unitID = 'unit' + @hResponseObj[:writerMissingIdCount]
   @xml.tag!('gml:DerivedUnit', {'gml:id' => unitID}) do
      @xml.tag!('gml:identifier', {'codeSpace' => hDerived[:codeSpace]}, hDerived[:identifier])
      @xml.tag!('gml:name', hDerived[:name])
      @xml.tag!('gml:remarks', hDerived[:remarks])
      @xml.tag!('gml:catalogSymbol', hDerived[:catalogSymbol])
      aTerms = hDerived[:derivationUnitTerm]
      aTerms.each do |term|
         @xml.tag!('gml:derivationUnitTerm', term)
      end
   end

end