Module: Mongoid::Contextual::Queryable

Included in:
Memory, Mongo, None
Defined in:
build/mongoid-master/lib/mongoid/contextual/queryable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



11
12
13
# File 'build/mongoid-master/lib/mongoid/contextual/queryable.rb', line 11

def collection
  @collection
end

#collection The collection to query against.(Thecollectiontoqueryagainst.) ⇒ Object (readonly)



11
# File 'build/mongoid-master/lib/mongoid/contextual/queryable.rb', line 11

attr_reader :collection, :criteria, :klass

#criteriaObject (readonly)

Returns the value of attribute criteria.



11
12
13
# File 'build/mongoid-master/lib/mongoid/contextual/queryable.rb', line 11

def criteria
  @criteria
end

#criteria The criteria for the context.(Thecriteria) ⇒ Object (readonly)



11
# File 'build/mongoid-master/lib/mongoid/contextual/queryable.rb', line 11

attr_reader :collection, :criteria, :klass

#klassObject (readonly)

Returns the value of attribute klass.



11
12
13
# File 'build/mongoid-master/lib/mongoid/contextual/queryable.rb', line 11

def klass
  @klass
end

#klass The klass for the criteria.(Theklass) ⇒ Object (readonly)



11
# File 'build/mongoid-master/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?

Examples:

Is the context empty?

context.blank?

Returns:

  • (true, false)

    If the context is empty.

Since:

  • 3.0.0



21
22
23
# File 'build/mongoid-master/lib/mongoid/contextual/queryable.rb', line 21

def blank?
  !exists?
end