Class: Moped::BSON::Types::CodeWithScope

Inherits:
Object
  • Object
show all
Defined in:
lib/moped/bson/types.rb

Class Method Summary collapse

Class Method Details

.__bson_load__(io) ⇒ Object



9
10
11
12
13
14
# File 'lib/moped/bson/types.rb', line 9

def self.__bson_load__(io)
  io.read 4 # swallow the length
  code = io.read(*io.read(4).unpack(INT32_PACK)).from_utf8_binary.chop!
  scope = BSON::Document.deserialize(io)
  Code.new(code, scope)
end