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
|
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/module_date.rb', line 19
def self.unpack(date, time, type, hResponseObj)
intMetadataClass = InternalMetadata.new
hDate = intMetadataClass.newDate
if date.nil? || date == ''
hResponseObj[:readerExecutionMessages] << 'ERROR: FGDC reader: date missing from dateType creation'
hResponseObj[:readerExecutionPass] = false
return nil
end
if type.nil? || type == ''
hResponseObj[:readerExecutionMessages] << 'ERROR: FGDC reader: role missing from dateType creation'
hResponseObj[:readerExecutionPass] = false
return nil
end
hDateTime = DateTime.unpack(date, time, hResponseObj)
unless hDateTime.nil?
hDate[:date] = hDateTime[:dateTime]
hDate[:dateResolution] = hDateTime[:dateResolution]
hDate[:dateType] = type
return hDate
end
return nil
end
|