Module: Mongoid::Criteria::Queryable::Extensions::Regexp::ClassMethods

Defined in:
build/mongoid-master/lib/mongoid/criteria/queryable/extensions/regexp.rb

Instance Method Summary collapse

Instance Method Details

#evolve(object) ⇒ Regexp

Evolve the object into a regex.

Examples:

Evolve the object to a regex.

Regexp.evolve("\A[123]")

Parameters:

Returns:

  • (Regexp)

    The evolved regex.

Since:

  • 1.0.0



34
35
36
37
38
# File 'build/mongoid-master/lib/mongoid/criteria/queryable/extensions/regexp.rb', line 34

def evolve(object)
  __evolve__(object) do |obj|
    ::Regexp.new(obj)
  end
end