Sha256: 6d485b58ccd416dd78a5594b43e304bf1a7766bd778e6d03f788e0640af38e28

Contents?: true

Size: 1.55 KB

Versions: 11

Compression:

Stored size: 1.55 KB

Contents

# unpack voucher
# Reader - ADIwg JSON V1 to internal data structure

# History:
# 	Stan Smith 2013-11-21 original script
#   Stan Smith 2014-07-07 resolve require statements using Mdtranslator.reader_module
#   Stan Smith 2014-12-15 refactored to handle namespacing readers and writers

require $ReaderNS.readerModule('module_responsibleParty')

module ADIWG
    module Mdtranslator
        module Readers
            module MdJson

                module Voucher

                    def self.unpack(hVoucher)

                        # instance classes needed in script
                        intMetadataClass = InternalMetadata.new
                        intTaxVoucher = intMetadataClass.newTaxonVoucher

                        # taxonomy voucher - specimen
                        if hVoucher.has_key?('specimen')
                            s = hVoucher['specimen']
                            if s != ''
                                intTaxVoucher[:specimen] = s
                            end
                        end

                        # taxonomy - repository - responsible party
                        if hVoucher.has_key?('repository')
                            hRepository = hVoucher['repository']
                            unless hRepository.empty?
                                intTaxVoucher[:repository] = $ReaderNS::ResponsibleParty.unpack(hRepository)
                            end
                        end

                        return intTaxVoucher

                    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/readers/mdJson/modules_1.0/module_voucher.rb
adiwg-mdtranslator-1.2.0 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_voucher.rb
adiwg-mdtranslator-1.1.1 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_voucher.rb
adiwg-mdtranslator-1.1.0 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_voucher.rb
adiwg-mdtranslator-1.0.0 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_voucher.rb
adiwg-mdtranslator-1.0.0rc4 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_voucher.rb
adiwg-mdtranslator-1.0.0rc3 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_voucher.rb
adiwg-mdtranslator-1.0.0rc2 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_voucher.rb
adiwg-mdtranslator-1.0.0rc1 lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_voucher.rb
adiwg-mdtranslator-0.12.1 lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_voucher.rb
adiwg-mdtranslator-0.12.0 lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_voucher.rb