Module: BSON::Regexp::ClassMethods

Defined in:
lib/bson/regexp.rb

Overview

Since:

  • 2.0.0

Instance Method Summary collapse

Instance Method Details

#from_bson(buffer) ⇒ Regexp

Deserialize the regular expression from BSON.

Parameters:

  • buffer (ByteBuffer)

    The byte buffer.

Returns:

  • (Regexp)

    The decoded regular expression.

See Also:

Since:

  • 2.0.0



256
257
258
259
260
# File 'lib/bson/regexp.rb', line 256

def from_bson(buffer)
  pattern = buffer.get_cstring
  options = buffer.get_cstring
  Raw.new(pattern, options)
end