Class: Synapse::EventStore::Mongo::Template
- Inherits:
-
Common::Mongo::BaseTemplate
- Object
- Common::Mongo::BaseTemplate
- Synapse::EventStore::Mongo::Template
- Defined in:
- lib/synapse/event_store/mongo/template.rb
Overview
Template for accessing collections needed by the event store
Instance Attribute Summary collapse
-
#event_collection_name ⇒ String
Name of the collection containing domain events.
-
#snapshot_collection_name ⇒ String
Name of the collection containing snapshot events.
Attributes inherited from Common::Mongo::BaseTemplate
#database_name, #password, #username
Instance Method Summary collapse
- #event_collection ⇒ Mongo::Collection
- #initialize(client) ⇒ undefined constructor
- #snapshot_collection ⇒ Mongo::Collection
Constructor Details
#initialize(client) ⇒ undefined
14 15 16 17 18 19 |
# 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 |
Instance Attribute Details
#event_collection_name ⇒ String
Returns Name of the collection containing domain events.
7 8 9 |
# File 'lib/synapse/event_store/mongo/template.rb', line 7 def event_collection_name @event_collection_name end |
#snapshot_collection_name ⇒ String
Returns Name of the collection containing snapshot events.
10 11 12 |
# File 'lib/synapse/event_store/mongo/template.rb', line 10 def snapshot_collection_name @snapshot_collection_name end |
Instance Method Details
#event_collection ⇒ Mongo::Collection
22 23 24 |
# File 'lib/synapse/event_store/mongo/template.rb', line 22 def event_collection database.collection @event_collection_name end |
#snapshot_collection ⇒ Mongo::Collection
27 28 29 |
# File 'lib/synapse/event_store/mongo/template.rb', line 27 def snapshot_collection database.collection @snapshot_collection_name end |