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
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_attributeGroup.rb', line 17
def self.unpack(hAttGroup, responseObj)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
inContext = 'coverage description'
if hAttGroup.empty?
@MessagePath.issueWarning(50, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intAttGroup = intMetadataClass.newAttributeGroup
outContext = inContext + ' attribute group'
if hAttGroup.has_key?('attributeContentType')
hAttGroup['attributeContentType'].each do |item|
unless item == ''
intAttGroup[:attributeContentTypes] << item
end
end
end
if intAttGroup[:attributeContentTypes].empty?
@MessagePath.issueError(51, responseObj, inContext)
end
if hAttGroup.has_key?('attribute')
aItems = hAttGroup['attribute']
aItems.each do |item|
hReturn = Attribute.unpack(item, responseObj, outContext)
unless hReturn.nil?
intAttGroup[:attributes] << hReturn
end
end
end
return intAttGroup
end
|