Sha256: e0917dd02cb69f41027c52fd35a17159b47d7cba04d576d8473438ac5c92df3e
Contents?: true
Size: 354 Bytes
Versions: 41
Compression:
Stored size: 354 Bytes
Contents
class DateTime def to_bson(*args) { MongoDoc::BSON::CLASS_KEY => self.class.name, 'dt' => strftime, 'sg' => start } end def self.bson_create(bson_hash, options = nil) DateTime.parse(*bson_hash.values_at('dt', 'sg')) end def self.cast_from_string(string) DateTime.parse(string) unless string.blank? end end
Version data entries
41 entries across 41 versions & 2 rubygems