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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_associatedResource.rb', line 17
def self.unpack(hAssocRes)
intMetadataClass = InternalMetadata.new
intAssocRes = intMetadataClass.newAssociatedResource
if hAssocRes.has_key?('associationType')
s = hAssocRes['associationType']
if s != ''
intAssocRes[:associationType] = s
end
end
if hAssocRes.has_key?('initiativeType')
s = hAssocRes['initiativeType']
if s != ''
intAssocRes[:initiativeType] = s
end
end
if hAssocRes.has_key?('resourceType')
s = hAssocRes['resourceType']
if s != ''
intAssocRes[:resourceType] = s
end
end
if hAssocRes.has_key?('resourceCitation')
hCitation = hAssocRes['resourceCitation']
unless hCitation.empty?
intAssocRes[:resourceCitation] = Adiwg_Citation.unpack(hCitation)
end
end
if hAssocRes.has_key?('metadataCitation')
hCitation = hAssocRes['metadataCitation']
unless hCitation.empty?
intAssocRes[:metadataCitation] = Adiwg_Citation.unpack(hCitation)
end
end
return intAssocRes
end
|