Class: Mongo::RegexpOfHolding Deprecated
- 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
deprecated
Deprecated.
we’re no longer supporting this.
Constructor Details
#initialize(str, options, extra_options_str) ⇒ RegexpOfHolding
we’re no longer supporting this.
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.
37 38 39 40 41 42 |
# File 'lib/mongo/types/regexp_of_holding.rb', line 37 def initialize(str, , ) warn "RegexpOfHolding is deprecated; the modifiers i, m, and x will be stored automatically as BSON." + "If you're only storing the options i, m, and x, you can safely ignore this message." 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 |