Class: MongoRequestLogger::MongoidConfig::ClientFactory
- Inherits:
-
Object
- Object
- MongoRequestLogger::MongoidConfig::ClientFactory
- Defined in:
- lib/mongo_request_logger/mongoid_config.rb
Class Method Summary collapse
Class Method Details
.create(configuration) ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mongo_request_logger/mongoid_config.rb', line 28 def self.create configuration raise unless configuration if configuration[:uri] Mongo::Client.new(configuration[:uri], (configuration)) else opts = (configuration).merge(database: configuration[:database]) opts = opts.merge(credentials(configuration)) Mongo::Client.new(configuration[:hosts], opts) end end |