יובל קוג'מן (Yuval Kogman) > Devel-Events-0.08 > Devel::Events::Handler::Callback

Download:
Devel-Events-0.08.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  0
View/Report Bugs
Source  

NAME ^

Devel::Events::Handler::Callback - An event handler that delegates to code references.

SYNOPSIS ^

        use Devel::Events::Handler::Callback;

        my $h = Devel::Events::Handler::Callback->new(
                callback => sub {
                        my ( $type, %data ) = @_;
                        # ...
                },
        );

DESCRIPTION ^

This object will let you easily create handlers that are callbacks. This is used extensively in the test suites.

ATTRIBUTES ^

callback

Accepts a code reference.

Required.

METHODS ^

new

This method is overridden so that when it is passed only one parameter that parameter will be used for the callback attribute.

new_event @event

Delegates to callback.

syntax highlighting: