EventStore::Tiny::Event
EventStore::Tiny::Event implements the following attributes and methods.
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', trans_store => $ts, data => {id => 42}, );
This event's UUID. By default a new UUID is created.
This event's timestamp. By default a new timestamp of the creation time is set.
This event's name. Setting this attribute on construction is required.
The EventStore::Tiny::TransformationStore object where this event's transformation subroutine will be looked up on application.
Concrete data for this event which will be used during application.
$event->transformation->($state);
Returns the transformation subroutine as a coderef for this event.
$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.
$logger
say $event->summary;
Returns a one-line summarized stringification of this event.
EventStore::Tiny
Copyright (c) 2018 Mirko Westermeier (mail: mirko@westermeier.de)
Released under the MIT License (see LICENSE.txt for details).
To install EventStore::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm EventStore::Tiny
CPAN shell
perl -MCPAN -e shell install EventStore::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.