module BSON::Symbol::ClassMethods
Public Instance Methods
Source
# File lib/bson/symbol.rb, line 187 def from_bson(buffer, **options) sym = buffer.get_string.intern if options[:mode] == :bson Raw.new(sym) else sym end end
Deserialize a symbol from BSON
.
@param [ ByteBuffer
] buffer The byte buffer.
@option options [ nil | :bson ] :mode Decoding mode to use.
@return [ Symbol
| BSON::Symbol::Raw
] The decoded symbol.
@see bsonspec.org/#/specification
@since 2.0.0