Class: BSON::BSON_C
- Inherits:
-
Object
- Object
- BSON::BSON_C
- Defined in:
- lib/bson/bson_c.rb
Class Method Summary collapse
- .deserialize(buf = nil) ⇒ Object
- .max_bson_size ⇒ Object
- .serialize(obj, check_keys = false, move_id = false, max_bson_size = BSON::DEFAULT_MAX_BSON_SIZE) ⇒ Object
- .update_max_bson_size(connection) ⇒ Object
Class Method Details
.deserialize(buf = nil) ⇒ Object
27 28 29 |
# File 'lib/bson/bson_c.rb', line 27 def self.deserialize(buf=nil) CBson.deserialize(ByteBuffer.new(buf).to_s) end |
.max_bson_size ⇒ Object
31 32 33 34 |
# File 'lib/bson/bson_c.rb', line 31 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 |
.serialize(obj, check_keys = false, move_id = false, max_bson_size = BSON::DEFAULT_MAX_BSON_SIZE) ⇒ Object
23 24 25 |
# File 'lib/bson/bson_c.rb', line 23 def self.serialize(obj, check_keys=false, move_id=false, max_bson_size=BSON::DEFAULT_MAX_BSON_SIZE) ByteBuffer.new(CBson.serialize(obj, check_keys, move_id, max_bson_size)) end |
.update_max_bson_size(connection) ⇒ Object
36 37 38 39 |
# File 'lib/bson/bson_c.rb', line 36 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 |