Class: Mongoid::Matchable::Regexp
- Defined in:
- lib/mongoid/matchable/regexp.rb
Overview
Defines behavior for handling regular expressions in embedded documents.
Instance Attribute Summary
Attributes inherited from Default
Instance Method Summary collapse
-
#matches?(regexp) ⇒ true, false
Does the supplied query match the attribute?.
Methods inherited from Default
Constructor Details
This class inherits a constructor from Mongoid::Matchable::Default
Instance Method Details
#matches?(regexp) ⇒ true, false
Does the supplied query match the attribute?
18 19 20 21 22 23 24 |
# File 'lib/mongoid/matchable/regexp.rb', line 18 def matches?(regexp) if native_regexp = regexp.try(:compile) super(native_regexp) else super end end |