Class: Euston::EventStore::Persistence::Mongodb::MongoPersistenceFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/euston-eventstore/persistence/mongodb/mongo_persistence_factory.rb

Class Method Summary collapse

Class Method Details

.buildObject



18
19
20
21
22
23
24
25
26
# File 'lib/euston-eventstore/persistence/mongodb/mongo_persistence_factory.rb', line 18

def self.build
  config = Config.instance
  options = {}
  options.merge!(:logger => config.logger) unless config.logger.nil?

  @connection ||= Mongo::Connection.from_uri config.uri, options

  MongoPersistenceEngine.new @connection.db(config.database)
end