Sha256: 42d9c574c0458fefdfeea1a0e7befde926792f361c2952ea4ac8253cc3945337

Contents?: true

Size: 1.54 KB

Versions: 5

Compression:

Stored size: 1.54 KB

Contents

# ISO <<CodeLists>> gmd:CI_DateTypeCode

# from http://mdtranslator.herokuapp.com/api/codelists?format=xml
# History:
# 	Stan Smith 2013-08-09 original script
#   Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
#   Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
#   Stan Smith 2014-12-15 replaced NOAA CT_CodelistCatalogue with mdTranslator CT_CodelistCatalogue

module ADIWG
    module Mdtranslator
        module Writers
            module Iso

                class CI_DateTypeCode

                    def initialize(xml)
                        @xml = xml
                    end

                    def writeXML(codeName)
                        case (codeName)
                            when 'creation' then
                                codeID = '001'
                            when 'publication' then
                                codeID = '002'
                            when 'revision' then
                                codeID = '003'
                            else
                                codeID = 'non-ISO codeName'
                        end

                        # write xml
                        @xml.tag!('gmd:CI_DateTypeCode', {:codeList => 'http://mdtranslator.herokuapp.com/api/codelists?format=xml#CI_DateTypeCode',
                                                          :codeListValue => "#{codeName}",
                                                          :codeSpace => "#{codeID}"})
                    end

                end

            end
        end
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
adiwg-mdtranslator-1.0.0rc3 lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb
adiwg-mdtranslator-1.0.0rc2 lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb
adiwg-mdtranslator-1.0.0rc1 lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb
adiwg-mdtranslator-0.12.1 lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb
adiwg-mdtranslator-0.12.0 lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb