Sha256: 0045b09ceb77f220ffe9cb20a9f87fb895a0a9df272947208b1e09a8a0e5cdc6
Contents?: true
Size: 476 Bytes
Versions: 28
Compression:
Stored size: 476 Bytes
Contents
module CassandraObject module Types class TimeWithZoneType < BaseType def encode(time) raise ArgumentError.new("#{self} requires a Time") unless time.kind_of?(Time) time.utc.xmlschema(6) end def decode(str) return nil if str.empty? raise ArgumentError.new("Cannot convert #{str} into a Time") unless str.kind_of?(String) && str.match(TimeType::REGEX) Time.xmlschema(str).in_time_zone end end end end
Version data entries
28 entries across 28 versions & 1 rubygems