Sha256: b999c89157853a614097a0ed079601fc3a9955ad4f52697ecf2f3706c616a3c6

Contents?: true

Size: 323 Bytes

Versions: 19

Compression:

Stored size: 323 Bytes

Contents

module CassandraObject
  module Types
    class TimeType < BaseType
      def encode(time)
        raise ArgumentError.new("#{time.inspect} is not a Time") unless time.kind_of?(Time)
        time.utc.xmlschema(6)
      end

      def decode(str)
        Time.parse(str).utc if str
      rescue

      end
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
gotime-cassandra_object-4.12.2 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.12.1 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.12.0 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.11.6 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.11.5 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.11.4 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.11.3 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.11.2 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.11.1 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.11.0 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.10.5 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.10.4 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.10.3 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.10.2 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.10.1 lib/cassandra_object/types/time_type.rb
cassandra_object_rails-0.0.1 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.10.0 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.9.2 lib/cassandra_object/types/time_type.rb
gotime-cassandra_object-4.9.1 lib/cassandra_object/types/time_type.rb