class Synapse::EventStore::Mongo::Template
Template
for accessing collections needed by the event store
Attributes
event_collection_name[RW]
@return [String] Name of the collection containing domain events
snapshot_collection_name[RW]
@return [String] Name of the collection containing snapshot events
Public Class Methods
new(client)
click to toggle source
@param [Mongo::MongoClient] client @return [undefined]
Calls superclass method
Synapse::Common::Mongo::BaseTemplate::new
# File lib/synapse/event_store/mongo/template.rb, line 14 def initialize(client) super @event_collection_name = 'domain_events' @snapshot_collection_name = 'snapshot_events' end
Public Instance Methods
event_collection()
click to toggle source
@return [Mongo::Collection]
# File lib/synapse/event_store/mongo/template.rb, line 22 def event_collection database.collection @event_collection_name end
snapshot_collection()
click to toggle source
@return [Mongo::Collection]
# File lib/synapse/event_store/mongo/template.rb, line 27 def snapshot_collection database.collection @snapshot_collection_name end