Class: BSON::MinKey
- Inherits:
-
Object
- Object
- BSON::MinKey
- Includes:
- JSON, Specialized, Comparable
- Defined in:
- lib/bson/min_key.rb
Overview
Represents a $minKey type, which compares less than any other value in the specification.
Constant Summary collapse
- BSON_TYPE =
A $minKey is type 0xFF in the BSON spec.
255.chr.force_encoding(BINARY).freeze
- LESSER =
Constant for always evaluating lesser in a comparison.
-1.freeze
Instance Method Summary collapse
-
#<=>(other) ⇒ Integer
When comparing a min key with any other object, the min key will always be lesser.
-
#as_json(*args) ⇒ Hash
Get the min key as JSON hash data.
Methods included from Specialized
Methods included from JSON
Instance Method Details
#<=>(other) ⇒ Integer
When comparing a min key with any other object, the min key will always be lesser.
49 50 51 |
# File 'lib/bson/min_key.rb', line 49 def <=>(other) LESSER end |
#as_json(*args) ⇒ Hash
Get the min key as JSON hash data.
61 62 63 |
# File 'lib/bson/min_key.rb', line 61 def as_json(*args) { "$minKey" => 1 } end |