Class: BSON::Boolean
- Inherits:
-
Object
- Object
- BSON::Boolean
- Defined in:
- lib/bson/boolean.rb
Overview
Represents a boolean type, which compares less than any other value in the specification.
Constant Summary collapse
- BSON_TYPE =
A boolean is type 0x08 in the BSON spec.
8.chr.force_encoding(BINARY).freeze
Class Method Summary collapse
-
.from_bson(bson) ⇒ TrueClass, FalseClass
Deserialize a boolean from BSON.
Class Method Details
.from_bson(bson) ⇒ TrueClass, FalseClass
Deserialize a boolean from BSON.
39 40 41 |
# File 'lib/bson/boolean.rb', line 39 def self.from_bson(bson) bson.readbyte.chr == TrueClass::TRUE_BYTE end |