Module: Adiwg_ResourceSpecificUsage

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

Class Method Summary collapse

Class Method Details

.unpack(hUsage) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_resourceSpecificUsage.rb', line 14

def self.unpack(hUsage)

	# instance classes needed in script
	intMetadataClass = InternalMetadata.new
	intUsage = intMetadataClass.newDataUsage

	# resource specific usage - specific usage
	if hUsage.has_key?('specificUsage')
		s = hUsage['specificUsage']
		if s != ''
			intUsage[:specificUsage] = s
		end
	end

	# resource specific usage - user determined limitations
	if hUsage.has_key?('userDeterminedLimitation')
		s = hUsage['userDeterminedLimitation']
		if s != ''
			intUsage[:userLimits] = s
		end
	end

	# taxonomy - repository - responsible party
	if hUsage.has_key?('userContactInfo')
		aContacts = hUsage['userContactInfo']
		unless aContacts.empty?
			aContacts.each do |hContact|
				intUsage[:userContacts] << Adiwg_ResponsibleParty.unpack(hContact)
			end
		end
	end

	return intUsage

end