Module: Mongoid::Matchers
- Defined in:
- lib/mongoid/matchers/gt.rb,
lib/mongoid/matchers.rb,
lib/mongoid/matchers/in.rb,
lib/mongoid/matchers/lt.rb,
lib/mongoid/matchers/ne.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
Overview
:nodoc:
Defined Under Namespace
Classes: All, Default, Exists, Gt, Gte, In, Lt, Lte, Ne, Nin, Size
Instance Method Summary collapse
-
#matches?(selector) ⇒ Boolean
Determines if this document has the attributes to match the supplied MongoDB selector.
Instance Method Details
#matches?(selector) ⇒ Boolean
Determines if this document has the attributes to match the supplied MongoDB selector. Used for matching on embedded associations.
18 19 20 21 22 23 |
# File 'lib/mongoid/matchers.rb', line 18 def matches?(selector) selector.each_pair do |key, value| return false unless matcher(key, value).matches?(value) end true end |