struct

Aquamarine::Event

Inherits Struct < Value < Object

Event is a data structure representing an event in the domain.

Constructors

new(event_id : UUID = UUID.random, data : Hash(K, V), K -> V | Nil = nil, metadata : Hash(K, V), K -> V | Nil = nil)

Instantiates a new event.

@param metadata [Hash] Event metadata that is not part of the domain @param data [Hash] Event data that belongs to the application domain @return [Event]

Source
new(event_id : UUID, data, metadata)
Source

Instance methods

==(event)

Checks if given event is equal.

Two events are treated equal if:

  • they are of the same event class
  • they have identical event ID
  • they have identical event data

Event metadata is not taken into account in comparing two events.

@param event [Event] Event object to compare @return [Bool]

Source
data
Source
event_id
Source
event_type
Source
metadata
Source
type

Type of the event @return [String]

Source

Nested types