Module: BSON::FalseClass
- Defined in:
- lib/bson/false_class.rb
Overview
Injects behaviour for encoding and decoding false values to and from raw bytes as specified by the BSON spec.
Constant Summary collapse
- FALSE_BYTE =
A false value in the BSON spec is 0x00.
0.chr.force_encoding(BINARY).freeze
Instance Method Summary collapse
-
#bson_type ⇒ String
The BSON type for false values is the general boolean type of 0x08.
-
#to_bson(encoded = ''.force_encoding(BINARY)) ⇒ String
Get the false boolean as encoded BSON.
Instance Method Details
#bson_type ⇒ String
The BSON type for false values is the general boolean type of 0x08.
38 39 40 |
# File 'lib/bson/false_class.rb', line 38 def bson_type Boolean::BSON_TYPE end |
#to_bson(encoded = ''.force_encoding(BINARY)) ⇒ String
Get the false boolean as encoded BSON.
52 53 54 |
# File 'lib/bson/false_class.rb', line 52 def to_bson(encoded = ''.force_encoding(BINARY)) encoded << FALSE_BYTE end |