Class: Synapse::Serialization::SerializedDomainEventMessageBuilder
Overview
Message builder capable of producing SerializedDomainEventMessage instances
Instance Attribute Summary collapse
#id, #metadata, #payload, #timestamp
Instance Method Summary
collapse
build
Instance Attribute Details
#aggregate_id ⇒ Object
41
42
43
|
# File 'lib/synapse/serialization/message/serialized_message_builder.rb', line 41
def aggregate_id
@aggregate_id
end
|
#sequence_number ⇒ Integer
44
45
46
|
# File 'lib/synapse/serialization/message/serialized_message_builder.rb', line 44
def sequence_number
@sequence_number
end
|
Instance Method Details
59
60
61
|
# File 'lib/synapse/serialization/message/serialized_message_builder.rb', line 59
def build
SerializedDomainEventMessage.new @id, @metadata, @payload, @timestamp, @aggregate_id, @sequence_number
end
|
#from_data(data, serializer) ⇒ undefined
49
50
51
52
53
54
55
56
|
# File 'lib/synapse/serialization/message/serialized_message_builder.rb', line 49
def from_data(data, serializer)
@id = data.id
@metadata ||= LazyObject.new data.metadata, serializer
@payload ||= LazyObject.new data.payload, serializer
@timestamp = data.timestamp
@aggregate_id = data.aggregate_id
@sequence_number = data.sequence_number
end
|