Class: Mongoid::Collections::Master
- Defined in:
- lib/mongoid/collections/master.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
Instance Method Summary collapse
-
#initialize(master, name) ⇒ Master
constructor
Create the new database writer.
Constructor Details
#initialize(master, name) ⇒ Master
Create the new database writer. Will create a collection from the master database.
Example:
Master.new(master, "mongoid_people")
24 25 26 |
# File 'lib/mongoid/collections/master.rb', line 24 def initialize(master, name) @collection = master.collection(name) end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
6 7 8 |
# File 'lib/mongoid/collections/master.rb', line 6 def collection @collection end |