Sha256: 09af76075818523711271cf76e0b0ab3cbdde61a7993fc8c7bdbc9e6b378e711

Contents?: true

Size: 1.51 KB

Versions: 11

Compression:

Stored size: 1.51 KB

Contents

# ISO <<Class>> MD_Format
# writer output in XML

# History:
# 	Stan Smith 2013-08-26 original script
#   Stan Smith 2014-12-12 refactored to handle namespacing readers and writers

module ADIWG
    module Mdtranslator
        module Writers
            module Iso

                class MD_Format

                    def initialize(xml)
                        @xml = xml
                    end

                    def writeXML(rFormat)

                        @xml.tag!('gmd:MD_Format') do

                            # format - name - required
                            s = rFormat[:formatName]
                            if s.nil?
                                @xml.tag!('gmd:name', {'gco:nilReason' => 'missing'})
                            else
                                @xml.tag!('gmd:name') do
                                    @xml.tag!('gco:CharacterString', s)
                                end
                            end

                            # format - version - required
                            s = rFormat[:formatVersion]
                            if s.nil?
                                @xml.tag!('gmd:version', {'gco:nilReason' => 'unknown'})
                            else
                                @xml.tag!('gmd:version') do
                                    @xml.tag!('gco:CharacterString', s)
                                end
                            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/classes/class_format.rb
adiwg-mdtranslator-1.2.0 lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb
adiwg-mdtranslator-1.1.1 lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb
adiwg-mdtranslator-1.1.0 lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb
adiwg-mdtranslator-1.0.0 lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb
adiwg-mdtranslator-1.0.0rc4 lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb
adiwg-mdtranslator-1.0.0rc3 lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb
adiwg-mdtranslator-1.0.0rc2 lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb
adiwg-mdtranslator-1.0.0rc1 lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb
adiwg-mdtranslator-0.12.1 lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb
adiwg-mdtranslator-0.12.0 lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb