Module: BSON::Symbol
- Defined in:
- lib/bson/symbol.rb
Overview
Note:
Symbols are deprecated in the BSON spec, but they are still currently supported here for backwards compatibility.
Injects behaviour for encoding and decoding symbol values to and from raw bytes as specified by the BSON spec.
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- BSON_TYPE =
A symbol is type 0x0E in the BSON spec.
14.chr.force_encoding(BINARY).freeze
Instance Method Summary collapse
-
#to_bson(encoded = ''.force_encoding(BINARY)) ⇒ Symbol
Get the symbol as encoded BSON.
-
#to_bson_key(encoded = ''.force_encoding(BINARY)) ⇒ String
Get the symbol as a BSON key name encoded C symbol.