Sha256: fdaf04515c51edcd57db753d719f5a044ee020c9bbd5a02eecbde025ea2ec0b9

Contents?: true

Size: 1.05 KB

Versions: 17

Compression:

Stored size: 1.05 KB

Contents

# encoding: UTF-8

# --
# Copyright (C) 2008-2011 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 CBson class
module BSON
  class BSON_C

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

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

    def self.max_bson_size
      CBson.max_bson_size
    end

    def self.update_max_bson_size(connection)
      CBson.update_max_bson_size(connection)
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
vanity-1.7.1 vendor/ruby/1.9.1/gems/bson-1.3.1/lib/bson/bson_c.rb
bson-1.3.1-jruby lib/bson/bson_c.rb
bson-1.3.1 lib/bson/bson_c.rb
bson-1.3.0-jruby lib/bson/bson_c.rb
bson-1.3.0 lib/bson/bson_c.rb
bson-1.3.0.rc0-jruby lib/bson/bson_c.rb
bson-1.3.0.rc0 lib/bson/bson_c.rb
bson-1.2.4-jruby lib/bson/bson_c.rb
bson-1.2.4 lib/bson/bson_c.rb
bson-1.2.3-jruby lib/bson/bson_c.rb
bson-1.2.3 lib/bson/bson_c.rb
bson-1.2.2-jruby lib/bson/bson_c.rb
bson-1.2.2 lib/bson/bson_c.rb
bson-1.2.1-jruby lib/bson/bson_c.rb
bson-1.2.1 lib/bson/bson_c.rb
bson-1.2.0-jruby lib/bson/bson_c.rb
bson-1.2.0 lib/bson/bson_c.rb