Class: Synapse::Domain::DomainEventMessageBuilder

Inherits:
EventMessageBuilder show all
Defined in:
lib/synapse/domain/message_builder.rb

Overview

Message builder capable of producing DomainEventMessage instances

Instance Attribute Summary collapse

Attributes inherited from MessageBuilder

#id, #metadata, #payload, #timestamp

Instance Method Summary collapse

Methods inherited from MessageBuilder

build, #populate_defaults

Instance Attribute Details

#aggregate_idObject

Returns:

  • (Object)


14
15
16
# File 'lib/synapse/domain/message_builder.rb', line 14

def aggregate_id
  @aggregate_id
end

#sequence_numberInteger

Returns:

  • (Integer)


17
18
19
# File 'lib/synapse/domain/message_builder.rb', line 17

def sequence_number
  @sequence_number
end

Instance Method Details

#buildDomainEventMessage

Returns:



20
21
22
# File 'lib/synapse/domain/message_builder.rb', line 20

def build
  DomainEventMessage.new @id, @metadata, @payload, @timestamp, @aggregate_id, @sequence_number
end