Sha256: cd18452ccb2cceeb34c9eb49f0584da349a46b2ff78721b998cab7a69db67ea6
Contents?: true
Size: 1.15 KB
Versions: 15
Compression:
Stored size: 1.15 KB
Contents
# typed: true # frozen_string_literal: true require 'time' module Workato module Connector module Sdk class Schema module Type class Time < ::Time PRECISION = 6 def to_s(*args) if args.present? super else xmlschema(PRECISION) end end def self.from_time(value) new( value.year, value.month, value.day, value.hour, value.min, value.sec + Rational(value.nsec, 1_000_000_000), value.utc_offset ) end def self.from_date_time(value) new( value.year, value.month, value.day, value.hour, value.min, value.sec + Rational(value.nsec, 1_000_000_000), value.zone ) end def self.xmlschema(str) from_time(super(str)) end end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems