Module: Mongo::Protocol::Serializers::Zero 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 32-bit Zero.

Serializes and de-serializes one 32-bit Zero.

Class Method Summary collapse

Class Method Details

.serialize(buffer, value, validating_keys = BSON::Config.validating_keys?) ⇒ 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.

Serializes a 32-bit Zero into the buffer

Parameters:

  • buffer (String)

    Buffer to receive the serialized Zero.

  • value (Fixnum)

    Ignored value.

Returns:

  • (String)

    Buffer with serialized value.



95
96
97
# File 'lib/mongo/protocol/serializers.rb', line 95

def self.serialize(buffer, value, validating_keys = BSON::Config.validating_keys?)
  buffer.put_int32(ZERO)
end