Class: Euston::EventStore::Persistence::StreamHead

Inherits:
Object
  • Object
show all
Includes:
Mongodb::MongoStreamHead
Defined in:
lib/euston-eventstore/persistence/stream_head.rb,
lib/euston-eventstore/persistence/mongodb/mongo_stream_head.rb

Overview

Indicates the most recent information representing the head of a given stream.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mongodb::MongoStreamHead

from_hash, #to_hash

Constructor Details

#initialize(stream_id, head_revision, snapshot_revision) ⇒ StreamHead

Returns a new instance of StreamHead.



6
7
8
9
10
# File 'lib/euston-eventstore/persistence/stream_head.rb', line 6

def initialize stream_id, head_revision, snapshot_revision
  @stream_id = stream_id
  @head_revision = head_revision
  @snapshot_revision = snapshot_revision
end

Instance Attribute Details

#head_revisionObject (readonly)

Gets the value which indicates the revision, length, or number of events committed to the stream.



16
17
18
# File 'lib/euston-eventstore/persistence/stream_head.rb', line 16

def head_revision
  @head_revision
end

#snapshot_revisionObject (readonly)

Gets the value which indicates the revision at which the last snapshot was taken.



19
20
21
# File 'lib/euston-eventstore/persistence/stream_head.rb', line 19

def snapshot_revision
  @snapshot_revision
end

#stream_idObject (readonly)

Gets the value which uniquely identifies the stream where the last snapshot exceeds the allowed threshold.



13
14
15
# File 'lib/euston-eventstore/persistence/stream_head.rb', line 13

def stream_id
  @stream_id
end