# File lib/moped/bson/code.rb, line 16 def ==(other) BSON::Code === other && code == other.code && scope == other.scope end
# File lib/moped/bson/code.rb, line 32 def __bson_dump__(io, key) if scoped? io << Types::CODE_WITH_SCOPE io << key.to_bson_cstring code_start = io.bytesize io << START_LENGTH data = code.to_utf8_binary io << [data.bytesize+1].pack(INT32_PACK) io << data io << NULL_BYTE scope.__bson_dump__(io) io[code_start, 4] = [io.bytesize - code_start].pack(INT32_PACK) else io << Types::CODE io << key.to_bson_cstring data = code.to_utf8_binary io << [data.bytesize+1].pack(INT32_PACK) io << data io << NULL_BYTE end end
Generated with the Darkfish Rdoc Generator 2.