Module: BSON::String::ClassMethods

Defined in:
lib/bson/string.rb

Overview

Since:

  • 2.0.0

Instance Method Summary collapse

Instance Method Details

#from_bson(bson) ⇒ Regexp

Deserialize a string from BSON.

Parameters:

  • bson (BSON)

    The bson representing a string.

Returns:

  • (Regexp)

    The decoded string.

See Also:

Since:

  • 2.0.0



179
180
181
# File 'lib/bson/string.rb', line 179

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