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
65
66
67
68
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_scope.rb', line 19
def self.unpack(hScope, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hScope.empty?
@MessagePath.issueWarning(730, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intScope = intMetadataClass.newScope
outContext = 'scope'
outContext = inContext + ' > ' + outContext unless inContext.nil?
if hScope.has_key?('scopeCode')
intScope[:scopeCode] = hScope['scopeCode']
end
if intScope[:scopeCode].nil? || intScope[:scopeCode] == ''
@MessagePath.issueError(731, responseObj, inContext)
end
if hScope.has_key?('scopeDescription')
aScopeDes = hScope['scopeDescription']
aScopeDes.each do |item|
hScopeDes = ScopeDescription.unpack(item, responseObj, outContext)
unless hScopeDes.nil?
intScope[:scopeDescriptions] << hScopeDes
end
end
end
if hScope.has_key?('scopeExtent')
aExtents = hScope['scopeExtent']
aExtents.each do |item|
hExtent = Extent.unpack(item, responseObj, outContext)
unless hExtent.nil?
intScope[:extents] << hExtent
end
end
end
return intScope
end
|