Class: Euston::EventStore::SnapshotStreamPair

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#snapshotObject (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

#streamObject (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