Sha256: 5a93c187b25d29a95b0c38b96c4bb381984f3b033e3bdad2dd25c889d3ed4dd6

Contents?: true

Size: 1.26 KB

Versions: 8

Compression:

Stored size: 1.26 KB

Contents

# Copyright (C) 2013 10gen Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# A thin wrapper for the BSON C-Extension
module BSON
  class BSON_C

    def self.serialize(obj, check_keys=false, move_id=false, max_bson_size=DEFAULT_MAX_BSON_SIZE)
      ByteBuffer.new(CBson.serialize(obj, check_keys, move_id, max_bson_size))
    end

    def self.deserialize(buf=nil)
      CBson.deserialize(ByteBuffer.new(buf).to_s)
    end

    def self.max_bson_size
      warn "BSON::BSON_CODER.max_bson_size is deprecated and will be removed in v2.0."
      CBson.max_bson_size
    end

    def self.update_max_bson_size(connection)
      warn "BSON::BSON_CODER.update_max_bson_size is deprecated and now a no-op. It will be removed in v2.0."
      CBson.update_max_bson_size(connection)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bson-1.9.2-java lib/bson/bson_c.rb
bson-1.9.2 lib/bson/bson_c.rb
bson-1.9.1-java lib/bson/bson_c.rb
bson-1.9.1 lib/bson/bson_c.rb
bson-1.9.1.rc0-java lib/bson/bson_c.rb
bson-1.9.1.rc0 lib/bson/bson_c.rb
bson-1.9.0 lib/bson/bson_c.rb
bson-1.9.0-java lib/bson/bson_c.rb