Skip to content

Commit

Permalink
Update datetime handlers so that it passes string directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Oliveros committed Jun 27, 2024
1 parent 787b040 commit 1b702bb
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def self.unpack(hEvent, responseObj, inContext = nil)
end

if hEvent.has_key?('time')
intEvent[:time] = DateTime.unpack(hEvent['time'], responseObj, outContext)
intEvent[:time] = hEvent['time']
else
@MessagePath.issueWarning(40, responseObj, outContext)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,15 @@ def self.unpack(hRequestedDate, responseObj, inContext = nil)
intRequestedDate = intMetadataClass.newRequestedDate

if hRequestedDate.has_key?('requestedDateOfCollection')
hReturn = DateTime.unpack(hRequestedDate['requestedDateOfCollection'], responseObj, outContext)
unless hReturn.nil?
intRequestedDate[:requestedDateOfCollection] = hReturn
else
@MessagePath.issueError(161, responseObj, inContext)
end
intRequestedDate[:requestedDateOfCollection] = hRequestedDate['requestedDateOfCollection']
else
@MessagePath.issueError(161, responseObj, inContext)
end

if hRequestedDate.has_key?('latestAcceptableDate')
hReturn = DateTime.unpack(hRequestedDate['latestAcceptableDate'], responseObj, outContext)
unless hReturn.nil?
intRequestedDate[:latestAcceptableDate] = hReturn
else
@MessagePath.issueError(161, responseObj, inContext)
end
intRequestedDate[:latestAcceptableDate] = hRequestedDate['latestAcceptableDate']
else
@MessagePath.issueError(161, responseObj, inContext)
end

intRequestedDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ def self.unpack(hRevision, responseObj, inContext = nil)

if hRevision.has_key?('dateInfo')
hRevision['dateInfo'].each do |item|
hReturn = DateTime.unpack(item, responseObj, outContext)
unless hReturn.nil?
intRevision[:dateInfo] << hReturn
end
intRevision[:dateInfo] << item
end
else
@MessagePath.issueWarning(41, responseObj, outContext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def writeXML(hEnvironment)
end

unless hEnvironment[:meteorologicalConditions].nil?
@xml.tag!('mac:meteorologicalConditions') do
@xml.tag!('mac:meterologicalConditions') do
@xml.tag!('gco:CharacterString', hEnvironment[:meteorologicalConditions])
end
else
if @hResponseObj[:writerShowTags]
@xml.tag!('mac:meteorologicalConditions')
@xml.tag!('mac:meterologicalConditions')
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def self.build(hEvent)
json.trigger hEvent[:trigger]
json.context hEvent[:context]
json.sequence hEvent[:sequence]
json.time DateTime.build(hEvent[:time])
json.time hEvent[:time]
json.expectedObjective @Namespace.json_map(hEvent[:expectedObjectives], Objective)
json.relatedPass Pass.build(hEvent[:relatedPass])
json.relatedSensor @Namespace.json_map(hEvent[:relatedSensors], Instrument)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ module RequestedDate
def self.build(hRequestedDate)

Jbuilder.new do |json|
json.requestedDateOfCollection DateTime.build(hRequestedDate[:requestedDateOfCollection])
json.latestAcceptableDate DateTime.build(hRequestedDate[:latestAcceptableDate])
json.requestedDateOfCollection hRequestedDate[:requestedDateOfCollection]
json.latestAcceptableDate hRequestedDate[:latestAcceptableDate]
end

end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.build(hRevision)
Jbuilder.new do |json|
json.description hRevision[:description]
json.responsibleParty @Namespace.json_map(hRevision[:responsibleParties], ResponsibleParty)
json.dateInfo @Namespace.json_map(hRevision[:dateInfo], DateTime)
json.dateInfo hRevision[:dateInfo]
end

end
Expand Down

0 comments on commit 1b702bb

Please sign in to comment.