Sha256: 781ac43a04c852694a0e2bdbe5e91988f14733f770efb2761c03366526b2acbf

Contents?: true

Size: 1.33 KB

Versions: 11

Compression:

Stored size: 1.33 KB

Contents

# 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

module ADIWG
    module Mdtranslator
        module Writers
            module Iso

                class DerivedUnit

                    def initialize(xml)
                        @xml = xml
                    end

                    def writeXML(hDerived)

                        # 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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
adiwg-mdtranslator-1.2.1 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb
adiwg-mdtranslator-1.2.0 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb
adiwg-mdtranslator-1.1.1 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb
adiwg-mdtranslator-1.1.0 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb
adiwg-mdtranslator-1.0.0 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb
adiwg-mdtranslator-1.0.0rc4 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb
adiwg-mdtranslator-1.0.0rc3 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb
adiwg-mdtranslator-1.0.0rc2 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb
adiwg-mdtranslator-1.0.0rc1 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb
adiwg-mdtranslator-0.12.1 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb
adiwg-mdtranslator-0.12.0 lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb