Class: Moped::BSON::MinKey

Inherits:
Object show all
Defined in:
lib/moped/bson/min_key.rb

Overview

Represents the minimum key value in the database.

Class Method Summary collapse

Class Method Details

.===(other) ⇒ true, false

Check equality on the object.

Examples:

Check equality.

object == other

Parameters:

  • other (Object)

    The object to check against.

Returns:

  • (true, false)

    If the objects are equal.

Since:

  • 1.0.0



19
20
21
# File 'lib/moped/bson/min_key.rb', line 19

def ===(other)
  other == self
end

.__bson_dump__(io, key) ⇒ Object

Dump the min key to the raw bytes.

Examples:

Dump the min key.

Moped::BSON::MinKey.__bson_dump__("", "min")

Parameters:

  • io (String)

    The raw bytes to write to.

  • key (String)

    The field name.

Since:

  • 1.0.0



44
45
46
47
# File 'lib/moped/bson/min_key.rb', line 44

def __bson_dump__(io, key)
  io << Types::MIN_KEY
  io << key.to_bson_cstring
end

.__bson_load__(io) ⇒ Class

Load the min key from the raw data.

Examples:

Load the min key.

Moped::BSON::MinKey.__bson_load("")

Parameters:

  • io (String)

    The raw bytes.

Returns:

  • (Class)

    The Moped::BSON::MinKey class.

Since:

  • 1.0.0



33
# File 'lib/moped/bson/min_key.rb', line 33

def __bson_load__(io); self; end