Method: Mongoid::Criteria#initialize
- Defined in:
- lib/mongoid/criteria.rb
#initialize(klass) ⇒ Criteria
Create the new Criteria object. This will initialize the selector and options hashes, as well as the type of criteria.
Options:
type: One of :all, :first:, or :last klass: The class to execute on.
136 137 138 |
# File 'lib/mongoid/criteria.rb', line 136 def initialize(klass) @selector, @options, @klass, @documents = {}, {}, klass, [] end |