Methods

Class/Module Index [+]

Quicksearch

Mongoid::Collections

The collections module is used for providing functionality around setting up and updating collections.

Public Instance Methods

collection() click to toggle source

Get the collection for the class.

@note Defining methods instead of delegate to avoid calls to

Kernel.caller for class load performance reasons.

@example Get the collection.

person.collection

@return [ Collection ] The class collection.

@since 1.0.0

# File lib/mongoid/collections.rb, line 24
def collection
  self.class.collection
end
db() click to toggle source

Get the database for the class.

@note Defining methods instead of delegate to avoid calls to

Kernel.caller for class load performance reasons.

@example Get the database.

person.db

@return [ DB ] The class db.

@since 1.0.0

# File lib/mongoid/collections.rb, line 39
def db
  self.class.db
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.