Module: Moped::BSON::Extensions::Time

Included in:
Time
Defined in:
lib/moped/bson/extensions/time.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#__bson_dump__(io, key) ⇒ Object



13
14
15
16
17
# File 'lib/moped/bson/extensions/time.rb', line 13

def __bson_dump__(io, key)
  io << Types::TIME
  io << key.to_bson_cstring
  io << [(to_i * 1000) + (usec / 1000)].pack(INT64_PACK)
end