Module: BSON::Regexp::ClassMethods
- Defined in:
- lib/bson/regexp.rb
Overview
Instance Method Summary collapse
-
#from_bson(bson) ⇒ Regexp
Deserialize the regular expression from BSON.
Instance Method Details
#from_bson(bson) ⇒ Regexp
Deserialize the regular expression from BSON.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/bson/regexp.rb', line 95 def from_bson(bson) pattern = bson.gets(NULL_BYTE).from_bson_string.chop! = 0 while (option = bson.readbyte) != 0 case option when 105 # 'i' |= ::Regexp::IGNORECASE when 109, 115 # 'm', 's' |= ::Regexp::MULTILINE when 120 # 'x' |= ::Regexp::EXTENDED end end new(pattern, ) end |