Module: Mongo::Protocol::Serializers::Byte Private

Defined in:
lib/mongo/protocol/serializers.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

MongoDB wire protocol serialization strategy for a single byte.

Writes and fetches a single byte from the byte buffer.

Class Method Summary collapse

Class Method Details

.deserialize(buffer, options = {}) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deserializes a byte from the byte buffer.

Since:

  • 2.5.0


426
427
428
# File 'lib/mongo/protocol/serializers.rb', line 426

def self.deserialize(buffer, options = {})
  buffer.get_byte
end

.serialize(buffer, value, validating_keys = nil) ⇒ BSON::ByteBuffer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Writes a byte into the buffer.

Since:

  • 2.5.0


414
415
416
# File 'lib/mongo/protocol/serializers.rb', line 414

def self.serialize(buffer, value, validating_keys = nil)
  buffer.put_byte(value)
end