Module: Mongoid::Contextual::Queryable
Overview
Mixin module which adds methods to Mongoid::Criteria that indicate the criteria query result will be an empty set.
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
- #collection The collection to query against.(Thecollectiontoqueryagainst.) ⇒ Object readonly
-
#criteria ⇒ Object
readonly
Returns the value of attribute criteria.
- #criteria The criteria for the context.(Thecriteria) ⇒ Object readonly
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
- #klass The klass for the criteria.(Theklass) ⇒ Object readonly
Instance Method Summary collapse
-
#blank? ⇒ true | false
(also: #empty?)
Is the enumerable of matching documents empty?.
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
11 12 13 |
# File 'lib/mongoid/contextual/queryable.rb', line 11 def collection @collection end |
#collection The collection to query against.(Thecollectiontoqueryagainst.) ⇒ Object (readonly)
11 |
# File 'lib/mongoid/contextual/queryable.rb', line 11 attr_reader :collection, :criteria, :klass |
#criteria ⇒ Object (readonly)
Returns the value of attribute criteria.
11 12 13 |
# File 'lib/mongoid/contextual/queryable.rb', line 11 def criteria @criteria end |
#criteria The criteria for the context.(Thecriteria) ⇒ Object (readonly)
11 |
# File 'lib/mongoid/contextual/queryable.rb', line 11 attr_reader :collection, :criteria, :klass |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
11 12 13 |
# File 'lib/mongoid/contextual/queryable.rb', line 11 def klass @klass end |
#klass The klass for the criteria.(Theklass) ⇒ Object (readonly)
11 |
# File 'lib/mongoid/contextual/queryable.rb', line 11 attr_reader :collection, :criteria, :klass |
Instance Method Details
#blank? ⇒ true | false Also known as: empty?
Is the enumerable of matching documents empty?
19 20 21 |
# File 'lib/mongoid/contextual/queryable.rb', line 19 def blank? !exists? end |