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



7
8
9
10
11
# File 'lib/moped/bson/extensions/time.rb', line 7

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