Module: BSON::Regexp::ClassMethods
- Defined in:
- lib/bson/regexp.rb
Overview
Instance Method Summary collapse
-
#from_bson(buffer) ⇒ Regexp
Deserialize the regular expression from BSON.
Instance Method Details
#from_bson(buffer) ⇒ Regexp
Deserialize the regular expression from BSON.
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/bson/regexp.rb', line 178 def from_bson(buffer) pattern = buffer.get_cstring = 0 while (option = buffer.get_byte) != NULL_BYTE case option when IGNORECASE_VALUE |= ::Regexp::IGNORECASE when MULTILINE_VALUE, NEWLINE_VALUE |= ::Regexp::MULTILINE when EXTENDED_VALUE |= ::Regexp::EXTENDED end end Raw.new(pattern, ) end |