Clinton Gormley > App-Cerberus-0.10 > App::Cerberus::Plugin

Download:
App-Cerberus-0.10.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.10   Source   Latest Release: App-Cerberus-0.11

NAME ^

App::Cerberus::Plugin - A base class for App::Cerberus plugins

VERSION ^

version 0.10

DESCRIPTION ^

If you want to write a plugin for App::Cerberus then you must provide a request method, which accepts a Plack::Request object as its first argument, and a \%response hashref as its second.

    package App::Cerberus::Plugin::Foo;

    use parent 'App::Cerberus::Plugin';

    sub request {
        my ($self, $request, $response) = @_;

        $response->{foo} = {.....};

    }

Optionally, you can also add an init method, which will be called with any options that were specified in the config file:

    sub init {
        my ($self,@args) = @_;
        ...
    }

AUTHOR ^

Clinton Gormley <drtech@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 by Clinton Gormley.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: