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_phone.rb', line 22
def self.unpack(hPhone, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
intMetadataClass = InternalMetadata.new
intPhone = intMetadataClass.newPhone
if hPhone.empty?
@MessagePath.issueWarning(630, responseObj, inContext)
return nil
end
if hPhone.has_key?('phoneNumber')
intPhone[:phoneNumber] = hPhone['phoneNumber']
end
if hPhone['phoneNumber'].nil? || hPhone['phoneNumber'] == ''
@MessagePath.issueError(631, responseObj, inContext)
end
if hPhone.has_key?('phoneName')
unless hPhone['phoneName'] == ''
intPhone[:phoneName] = hPhone['phoneName']
end
end
if hPhone.has_key?('service')
intPhone[:phoneServiceTypes] = hPhone['service']
end
if intPhone[:phoneServiceTypes].empty?
@MessagePath.issueWarning(632, responseObj, inContext)
end
return intPhone
end
|