module BSON::Regexp::ClassMethods
Public Instance Methods
Source
# File lib/bson/regexp.rb, line 290 def from_bson(buffer, **opts) pattern = buffer.get_cstring options = buffer.get_cstring Raw.new(pattern, options) end
Deserialize the regular expression from BSON
.
@param [ ByteBuffer
] buffer The byte buffer.
@option opts [ nil | :bson ] :mode Decoding mode to use.
@return [ Regexp
] The decoded regular expression.
@see bsonspec.org/#/specification
@since 2.0.0