module BSON::Integer

def to_bson(buffer = ByteBuffer.new)

Other tags:
    Since: - 2.0.0

Other tags:
    See: http://bsonspec.org/#/specification -

Returns:
  • (BSON::ByteBuffer) - The buffer with the encoded object.

Other tags:
    Example: Get the integer as encoded BSON. -
def to_bson(buffer = ByteBuffer.new)
  if bson_int32?
    buffer.put_int32(self)
  elsif bson_int64?
    buffer.put_int64(self)
  else
    out_of_range!
  end
end