Sha256: 651c7f1115c96a22c91a107cae5da8dcd3f1e6ea12c3518f2ad1c383051bf15b
Contents?: true
Size: 467 Bytes
Versions: 16
Compression:
Stored size: 467 Bytes
Contents
# frozen_string_literal: true module Trusona module Helpers ## # Normalizes Strings, Date, DateTime, and Time into a UTC Time object module TimeNormalizer def normalize_time(time) return nil if time.nil? return time.to_time.gmtime if time.is_a?(DateTime) return time.gmtime if time.is_a?(Time) return Time.parse(time).gmtime if time.is_a?(String) return nil if time.is_a?(Date) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems