NAME
EventStore::Tiny::Event
REFERENCE
EventStore::Tiny::Event implements the following attributes and methods.
ATTRIBUTES
All these attributes can be manipulated by setters/getters with the attribute's name or can be set on construction:
my $event = EventStore::Tiny::Event->new(name => "Foo");
uuid
This event's UUID. By default a new UUID is created.
timestamp
This event's timestamp. By default a new timestamp of the creation time is set.
name
This event's name. Setting this attribute on construction is required.
transformation
This event's state transformation function, represented by a subref. By default it does nothing, so it should be set as a reasonable subref changing the given state argument (as a hashref) based on the given data (as a hashref) by side-effect.
METHODS
apply_to
$event->apply_to(\%state, $logger);
Applies this event's transformation to the given state (by side-effect). If a $logger
as a subref is given, it is used to log this application.
SEE ALSO
COPYRIGHT AND LICENSE
Copyright (c) 2018 Mirko Westermeier (mail: mirko@westermeier.de)
Released under the MIT License (see LICENSE.txt for details).