Class: Euston::EventStore::Snapshot
- Inherits:
-
Object
- Object
- Euston::EventStore::Snapshot
- Includes:
- Persistence::Mongodb::MongoSnapshot
- Defined in:
- lib/euston-eventstore/snapshot.rb,
lib/euston-eventstore/persistence/mongodb/mongo_snapshot.rb
Overview
Represents a materialized view of a stream at specific revision.
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Gets the metadata which provides additional, unstructured information about this snapshot.
-
#payload ⇒ Object
readonly
Gets the snapshot or materialized view of the stream at the revision indicated.
-
#stream_id ⇒ Object
readonly
Gets the value which uniquely identifies the stream to which the snapshot applies.
-
#stream_revision ⇒ Object
readonly
Gets the position at which the snapshot applies.
Instance Method Summary collapse
-
#initialize(stream_id, stream_revision, payload, headers = nil) ⇒ Snapshot
constructor
A new instance of Snapshot.
Methods included from Persistence::Mongodb::MongoSnapshot
Constructor Details
#initialize(stream_id, stream_revision, payload, headers = nil) ⇒ Snapshot
Returns a new instance of Snapshot.
5 6 7 8 9 10 |
# File 'lib/euston-eventstore/snapshot.rb', line 5 def initialize stream_id, stream_revision, payload, headers = nil @stream_id = stream_id @stream_revision = stream_revision @payload = payload @headers = headers || {} end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Gets the metadata which provides additional, unstructured information about this snapshot.
22 23 24 |
# File 'lib/euston-eventstore/snapshot.rb', line 22 def headers @headers end |
#payload ⇒ Object (readonly)
Gets the snapshot or materialized view of the stream at the revision indicated.
19 20 21 |
# File 'lib/euston-eventstore/snapshot.rb', line 19 def payload @payload end |
#stream_id ⇒ Object (readonly)
Gets the value which uniquely identifies the stream to which the snapshot applies.
13 14 15 |
# File 'lib/euston-eventstore/snapshot.rb', line 13 def stream_id @stream_id end |
#stream_revision ⇒ Object (readonly)
Gets the position at which the snapshot applies.
16 17 18 |
# File 'lib/euston-eventstore/snapshot.rb', line 16 def stream_revision @stream_revision end |