Devel::Events::Generator - An optional base role for event generators.


Devel-Events documentation  | view source Contained in the Devel-Events distribution.

Index


NAME

Top

Devel::Events::Generator - An optional base role for event generators.

SYNOPSIS

Top

	package MyGen;
	use Moose;

	with qw/Devel::Events::Generator/;

	sub whatever {
		my ( $self, @args ) = @_;

		# ...

		$self->send_event( @event );
	}

DESCRIPTION

Top

This convenience role provides a basic send_event method, useful for implementing generators.

ATTRIBUTES

Top

handler

Accepts any object.

Required.

METHODS

Top

send_event @event

Delegates to handler, calling the method new_event on it.

The field generator with the value of the generator object will be prepended.


Devel-Events documentation  | view source Contained in the Devel-Events distribution.