Class: XGen::Mongo::Driver::RegexpOfHolding

Inherits:
Regexp
  • Object
show all
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

Instance Method Summary collapse

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, options, extra_options_str)
  super(str, options)
  @extra_options_str = extra_options_str
end

Instance Attribute Details

#extra_options_strObject

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
  @extra_options_str
end