Method: Mongoid::Scope#initialize
- Defined in:
- lib/mongoid/scope.rb
#initialize(conditions = {}, &block) ⇒ Scope
Create the new Scope. If a block is passed in, this Scope will store the block for future calls to #extend.
14 15 16 17 |
# File 'lib/mongoid/scope.rb', line 14 def initialize(conditions = {}, &block) @conditions = conditions @extensions = Module.new(&block) if block_given? end |