Module: BSON::Symbol::ClassMethods

Defined in:
lib/bson/symbol.rb

Overview

Since:

  • 2.0.0

Instance Method Summary collapse

Instance Method Details

#from_bson(bson) ⇒ Regexp

Deserialize a symbol from BSON.

Parameters:

  • bson (BSON)

    The bson representing a symbol.

Returns:

  • (Regexp)

    The decoded symbol.

See Also:

Since:

  • 2.0.0



83
84
85
# File 'lib/bson/symbol.rb', line 83

def from_bson(bson)
  bson.read(Int32.from_bson(bson)).from_bson_string.chop!.intern
end