Module: Mongoo::Modifiers

Included in:
Base
Defined in:
lib/mongoo/modifiers.rb

Instance Method Summary collapse

Instance Method Details

#mod(opts = {}, &block) ⇒ Object


142
143
144
145
146
# File 'lib/mongoo/modifiers.rb', line 142

def mod(opts={}, &block)
  builder = ModifierBuilder.new(opts, self)
  block.call(builder)
  builder.run!
end

#mod!(opts = {}, &block) ⇒ Object


148
149
150
# File 'lib/mongoo/modifiers.rb', line 148

def mod!(opts={}, &block)
  mod(opts.merge(:safe => true), &block)
end