Class: Synapse::EventSourcing::EventStreamDecorator Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse/event_sourcing/stream_decorator.rb

Overview

This class is abstract.

Represents a mechanism for decorating event streams when aggregates are read or appended

Instance Method Summary collapse

Instance Method Details

#decorate_for_append(type_identifier, aggregate, stream) ⇒ DomainEventStream

Decorates an event stream when it is appended to the event store

Parameters:

  • type_identifier (String)
  • aggregate (AggregateRoot)
  • stream (DomainEventStream)

Returns:

  • (DomainEventStream)


22
23
24
# File 'lib/synapse/event_sourcing/stream_decorator.rb', line 22

def decorate_for_append(type_identifier, aggregate, stream)
  stream
end

#decorate_for_read(type_identifier, aggregate_id, stream) ⇒ DomainEventStream

Decorates an event stream when it is read from the event store

Parameters:

  • type_identifier (String)
  • aggregate_id (Object)
  • stream (DomainEventStream)

Returns:

  • (DomainEventStream)


12
13
14
# File 'lib/synapse/event_sourcing/stream_decorator.rb', line 12

def decorate_for_read(type_identifier, aggregate_id, stream)
  stream
end