Sha256: ca0601da1f95a107f3274f1152322a67f0b6abce934b4fa849cb07710cc9814c

Contents?: true

Size: 1.75 KB

Versions: 16

Compression:

Stored size: 1.75 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
#   Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
#   Stan Smith 2015-07-14 refactored to remove global namespace constants

require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_responsibleParty')

module ADIWG
    module Mdtranslator
        module Readers
            module MdJson

                module Voucher

                    def self.unpack(hVoucher, responseObj)

                        # 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] = ResponsibleParty.unpack(hRepository, responseObj)
                            end
                        end

                        return intTaxVoucher

                    end

                end

            end
        end
    end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
adiwg-mdtranslator-1.4.0 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta14 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta13 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta12 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta11 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta10 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta9 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta8 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta7 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta6 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta5 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta4 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta3 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta2 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.4.0.beta1 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb
adiwg-mdtranslator-1.3.0 lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_voucher.rb