Module: Mongo::Model::Assignment::ClassMethods

Defined in:
lib/mongo_db/model/assignment.rb

Instance Method Summary collapse

Instance Method Details

#assign(&block) ⇒ Object



59
60
61
62
63
# File 'lib/mongo_db/model/assignment.rb', line 59

def assign &block
  dsl = ::Mongo::Model::Assignment::Dsl.new
  dsl.instance_eval &block
  self._assign = (_assign || {}).merge dsl.to_h
end