Class: ADIWG::Mdtranslator::Writers::Iso19115_3::DerivedUnit

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

Instance Method Summary collapse

Constructor Details

#initialize(xml, hResponseObj) ⇒ DerivedUnit



14
15
16
17
# File 'lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_derivedUnit.rb', line 14

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

Instance Method Details

#writeXML(hDerived) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_derivedUnit.rb', line 19

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