This class handles the configuration and initialization of a mongodb database from options.
keys to remove from self to not pass through to Mongo::Connection
Configure the database connections. This will return an array containing the master and an array of slaves.
@example Configure the connection.
db.configure
@return [ Array<Mongo::DB, Array<Mongo:DB>> ] The Mongo databases.
@since 2.0.0.rc.1
# File lib/mongoid/config/database.rb, line 20 def configure [ master.db(name), slaves.map { |slave| slave.db(name) } ] end
Create the new db configuration class.
@example Initialize the class.
Config::Database.new( false, "uri" => { "mongodb://durran:password@localhost:27017/mongoid" } )
@param [ Hash ] options The configuration options.
@option options [ String ] :database The database name. @option options [ String ] :host The database host. @option options [ String ] :password The password for authentication. @option options [ Integer ] :port The port for the database. @option options [ String ] :uri The uri for the database. @option options [ String ] :username The user for authentication.
@since 2.0.0.rc.1
# File lib/mongoid/config/database.rb, line 41 def initialize(options = {}) merge!(options) end
Generated with the Darkfish Rdoc Generator 2.