Methods

Class/Module Index [+]

Quicksearch

Moped::BSON::Extensions::Array

Public Instance Methods

__bson_dump__(io, key) click to toggle source
# File lib/moped/bson/extensions/array.rb, line 21
def __bson_dump__(io, key)
  io << Types::ARRAY
  io << key.to_bson_cstring

  start = io.bytesize

  # write dummy length
  io << START_LENGTH

  index, length = 0, self.length

  while index < length
    slice(index).__bson_dump__(io, index.to_s)
    index += 1
  end

  io << EOD

  stop = io.bytesize
  io[start, 4] = [stop - start].pack(INT32_PACK)

  io
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.