Methods

Class/Module Index [+]

Quicksearch

Moped::BSON::Extensions::Hash::ClassMethods

Public Instance Methods

__bson_load__(io, doc = new) click to toggle source
# File lib/moped/bson/extensions/hash.rb, line 8
def __bson_load__(io, doc = new)
  # Swallow the first four (length) bytes
  io.read 4

  while (buf = io.readbyte) != 0
    key = io.gets(NULL_BYTE).from_utf8_binary.chop!

    if native_class = Types::MAP[buf]
      doc[key] = native_class.__bson_load__(io)
    end
  end

  doc
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.