Sha256: e683f029f24c9ec92afe3cf0f18d5af256d16c20043a6db533e590553f325d9e
Contents?: true
Size: 367 Bytes
Versions: 47
Compression:
Stored size: 367 Bytes
Contents
module CassandraObject module Types class DateType < BaseType FORMAT = '%Y-%m-%d' REGEX = /\A\d{4}-\d{2}-\d{2}\Z/ def encode(value) raise ArgumentError.new("#{value.inspect} is not a Date") unless value.kind_of?(Date) value.strftime(FORMAT) end def decode(str) Date.parse(str) end end end end
Version data entries
47 entries across 47 versions & 2 rubygems