Sha256: ca9a50752c33324e16db590a5a00221013426a3ca0fdb43e7d25207493acc369
Contents?: true
Size: 1.78 KB
Versions: 6
Compression:
Stored size: 1.78 KB
Contents
# unpack dateTime # Reader - ADIwg JSON V1 to internal data structure # History: # Stan Smith 2018-06-18 refactored error and warning messaging # Stan Smith 2016-10-05 refactored for mdJson 2.0 # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj) # Stan Smith 2015-07-14 refactored to remove global namespace constants # Stan Smith 2013-12-11 original script require 'adiwg/mdtranslator/internal/module_dateTimeFun' module ADIWG module Mdtranslator module Readers module MdJson module DateTime def self.unpack(sDateTime, responseObj, inContext = nil) @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson # return nil object if input is empty if sDateTime == '' @MessagePath.issueWarning(160, responseObj, inContext) return nil end # instance classes needed in script intMetadataClass = InternalMetadata.new intDateTime = intMetadataClass.newDateTime # dateTime - dateTime (required) # if dateTimeFromString fails, [0] = nil; [1] = 'ERROR' aDateTimeReturn = AdiwgDateTimeFun.dateTimeFromString(sDateTime) if aDateTimeReturn[1] == 'ERROR' @MessagePath.issueError(161, responseObj, inContext) else intDateTime[:dateTime] = aDateTimeReturn[0] intDateTime[:dateResolution] = aDateTimeReturn[1] end return intDateTime end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems