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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_scopeDescription.rb', line 15
def self.unpack(hScopeDes, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hScopeDes.empty?
@MessagePath.issueWarning(740, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intScopeDes = intMetadataClass.newScopeDescription
haveScope = false
if hScopeDes.has_key?('dataset')
unless hScopeDes['dataset'] == ''
intScopeDes[:dataset] = hScopeDes['dataset']
haveScope = true
end
end
if hScopeDes.has_key?('attributes')
unless hScopeDes['attributes'] == ''
intScopeDes[:attributes] = hScopeDes['attributes']
haveScope = true
end
end
if hScopeDes.has_key?('features')
unless hScopeDes['features'] == ''
intScopeDes[:features] = hScopeDes['features']
haveScope = true
end
end
if hScopeDes.has_key?('other')
unless hScopeDes['other'] == ''
intScopeDes[:other] = hScopeDes['other']
haveScope = true
end
end
unless haveScope
@MessagePath.issueError(741, responseObj, inContext)
end
return intScopeDes
end
|