Class: Euston::EventStore::SnapshotStreamPair
- Inherits:
-
Object
- Object
- Euston::EventStore::SnapshotStreamPair
- Defined in:
- lib/euston-eventstore/snapshot_stream_pair.rb
Overview
A pair of snapshot & stream to reload an object in a performant way
Instance Attribute Summary collapse
-
#snapshot ⇒ Object
readonly
A snapshot providing the state of the object up to the start of the stream.
-
#stream ⇒ Object
readonly
A stream of commits since the snapshot was taken.
Instance Method Summary collapse
-
#initialize(snapshot, stream) ⇒ SnapshotStreamPair
constructor
A new instance of SnapshotStreamPair.
Constructor Details
#initialize(snapshot, stream) ⇒ SnapshotStreamPair
Returns a new instance of SnapshotStreamPair.
5 6 7 8 |
# File 'lib/euston-eventstore/snapshot_stream_pair.rb', line 5 def initialize snapshot, stream @snapshot = snapshot @stream = stream end |
Instance Attribute Details
#snapshot ⇒ Object (readonly)
A snapshot providing the state of the object up to the start of the stream
11 12 13 |
# File 'lib/euston-eventstore/snapshot_stream_pair.rb', line 11 def snapshot @snapshot end |
#stream ⇒ Object (readonly)
A stream of commits since the snapshot was taken
14 15 16 |
# File 'lib/euston-eventstore/snapshot_stream_pair.rb', line 14 def stream @stream end |