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
71
72
73
74
75
76
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_dimension.rb', line 15
def self.unpack(hDimension, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hDimension.empty?
@MessagePath.issueWarning(170, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intDimension = intMetadataClass.newDimension
if hDimension.has_key?('dimensionType')
unless hDimension['dimensionType'] == ''
intDimension[:dimensionType] = hDimension['dimensionType']
end
end
if intDimension[:dimensionType].nil?
@MessagePath.issueError(171, responseObj, inContext)
end
if hDimension.has_key?('dimensionSize')
unless hDimension['dimensionSize'] == ''
intDimension[:dimensionSize] = hDimension['dimensionSize']
end
end
if intDimension[:dimensionSize].nil?
@MessagePath.issueError(172, responseObj, inContext)
end
if hDimension.has_key?('resolution')
hObject = hDimension['resolution']
unless hObject.empty?
hReturn = Measure.unpack(hObject, responseObj)
unless hReturn.nil?
intDimension[:resolution] = hReturn
end
end
end
if hDimension.has_key?('dimensionTitle')
unless hDimension['dimensionTitle'] == ''
intDimension[:dimensionTitle] = hDimension['dimensionTitle']
end
end
if hDimension.has_key?('dimensionDescription')
unless hDimension['dimensionDescription'] == ''
intDimension[:dimensionDescription] = hDimension['dimensionDescription']
end
end
return intDimension
end
|