lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb in adiwg-mdtranslator-0.10.2 vs lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb in adiwg-mdtranslator-0.12.0

- old
+ new

@@ -1,31 +1,42 @@ # ISO <<Class>> DerivedUnit # writer output in XML # History: # Stan Smith 2014-12-03 original script +# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers -class DerivedUnit +module ADIWG + module Mdtranslator + module Writers + module Iso - def initialize(xml) - @xml = xml - end + class DerivedUnit - def writeXML(hDerived) + def initialize(xml) + @xml = xml + end - # create and identity for the unit - $idCount = $idCount.succ - unitID = 'unit' + $idCount - @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 + def writeXML(hDerived) - end + # create and identity for the unit + $idCount = $idCount.succ + unitID = 'unit' + $idCount + @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 + + end + + end + end + end end