25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_metadata.rb', line 25
def self.unpack(hMetadata)
intMetadataClass = InternalMetadata.new
intMetadata = intMetadataClass.newMetadata
if hMetadata.has_key?('metadataInfo')
intMetadata[:metadataInfo] = Adiwg_MetadataInfo.unpack(hMetadata)
end
if hMetadata.has_key?('resourceInfo')
hResourceInfo = hMetadata['resourceInfo']
intMetadata[:resourceInfo] = Adiwg_ResourceInfo.unpack(hResourceInfo)
end
if hMetadata.has_key?('distributionInfo')
aDistributors = hMetadata['distributionInfo']
unless aDistributors.empty?
aDistributors.each do |hDistributor|
intMetadata[:distributorInfo] << Adiwg_DistributionInfo.unpack(hDistributor)
end
end
end
if hMetadata.has_key?('associatedResource')
aAssocRes = hMetadata['associatedResource']
unless aAssocRes.empty?
aAssocRes.each do |hAssocRes|
intMetadata[:associatedResources] << Adiwg_AssociatedResource.unpack(hAssocRes)
end
end
end
if hMetadata.has_key?('additionalDocumentation')
aAddDocs = hMetadata['additionalDocumentation']
unless aAddDocs.empty?
aAddDocs.each do |hAddDoc|
intMetadata[:additionalDocuments] << Adiwg_AdditionalDocumentation.unpack(hAddDoc)
end
end
end
return intMetadata
end
|