Class: XGen::Mongo::Driver::RegexpOfHolding
- Inherits:
-
Regexp
- Object
- Regexp
- XGen::Mongo::Driver::RegexpOfHolding
- Defined in:
- lib/mongo/types/regexp_of_holding.rb
Overview
A Regexp that can hold on to extra options and ignore them. Mongo regexes may contain option characters beyond ‘i’, ‘m’, and ‘x’. (Note that Mongo only uses those three, but that regexes coming from other languages may store different option characters.)
Note that you do not have to use this class at all if you wish to store regular expressions in Mongo. The Mongo and Ruby regex option flags are the same. Storing regexes is discouraged, in any case.
Instance Attribute Summary collapse
-
#extra_options_str ⇒ Object
Returns the value of attribute extra_options_str.
Instance Method Summary collapse
-
#initialize(str, options, extra_options_str) ⇒ RegexpOfHolding
constructor
str
andoptions
are the same as Regexp.
Constructor Details
#initialize(str, options, extra_options_str) ⇒ RegexpOfHolding
str
and options
are the same as Regexp. extra_options_str
contains all the other flags that were in Mongo but we do not use or understand.
36 37 38 39 |
# File 'lib/mongo/types/regexp_of_holding.rb', line 36 def initialize(str, , ) super(str, ) @extra_options_str = end |
Instance Attribute Details
#extra_options_str ⇒ Object
Returns the value of attribute extra_options_str.
31 32 33 |
# File 'lib/mongo/types/regexp_of_holding.rb', line 31 def @extra_options_str end |