Module: Mongoid::Matchers
- Included in:
- Components
- Defined in:
- lib/mongoid/matchers.rb,
lib/mongoid/matchers/gt.rb,
lib/mongoid/matchers/in.rb,
lib/mongoid/matchers/lt.rb,
lib/mongoid/matchers/ne.rb,
lib/mongoid/matchers/or.rb,
lib/mongoid/matchers/all.rb,
lib/mongoid/matchers/gte.rb,
lib/mongoid/matchers/lte.rb,
lib/mongoid/matchers/nin.rb,
lib/mongoid/matchers/size.rb,
lib/mongoid/matchers/exists.rb,
lib/mongoid/matchers/default.rb,
lib/mongoid/matchers/strategies.rb
Overview
:nodoc:
Defined Under Namespace
Modules: Strategies Classes: All, Default, Exists, Gt, Gte, In, Lt, Lte, Ne, Nin, Or, Size
Instance Method Summary collapse
-
#matches?(selector) ⇒ true, false
Determines if this document has the attributes to match the supplied MongoDB selector.
Instance Method Details
#matches?(selector) ⇒ true, false
Determines if this document has the attributes to match the supplied MongoDB selector. Used for matching on embedded associations.
19 20 21 22 23 24 25 26 |
# File 'lib/mongoid/matchers.rb', line 19 def matches?(selector) selector.each_pair do |key, value| unless Strategies.matcher(self, key, value).matches?(value) return false end end return true end |