Sha256: 17c99ca84209410fbccbbc3b6413c55e0440bf4fef0947d616efd334b45fdc20
Contents?: true
Size: 387 Bytes
Versions: 4
Compression:
Stored size: 387 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: class Factory #:nodoc: # Builds a new +Document+ from the supplied attributes. # # Example: # # <tt>Mongoid::Factory.build(Person, {})</tt> # # Options: # # attributes: The +Document+ attributes. def self.build(attributes) attributes["_type"].constantize.instantiate(attributes) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
mongoid-1.2.3 | lib/mongoid/factory.rb |
mongoid-1.2.2 | lib/mongoid/factory.rb |
mongoid-1.2.1 | lib/mongoid/factory.rb |
mongoid-1.2.0 | lib/mongoid/factory.rb |