Module: Adiwg_Voucher

Defined in:
lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_voucher.rb

Class Method Summary collapse

Class Method Details

.unpack(hVoucher) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_voucher.rb', line 12

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] = Adiwg_ResponsibleParty.unpack(hRepository)
		end
	end

	return intTaxVoucher

end