Tanker::Plugin - a base class for all Tanker plugins


Tanker documentation Contained in the Tanker distribution.

Index


Code Index:

NAME

Top

Tanker::Plugin - a base class for all Tanker plugins

SYNOPSIS

Top

use Tanker::Plugin;

my $plugin = new Tanker::Plugin ($pipeline);

$plugin->handle($request);

this class isn't designed to be used directly but subclassed and the handle method overridden

DESCRIPTION

Top

If a plugin is placed in a Tanker pipeline then (almost) every request that comes down the pipeline will be passed to it via the handle method.

It's then free to munge it as it wants.

AUTHOR

Top

Simon Wistow <simon@thegestalt.org>

SEE ALSO

Top

Tanker, Tanker::Config, Tanker::RequestGenerator, Tanker::ResponseHandler, Tanker::Request;


Tanker documentation Contained in the Tanker distribution.

package Tanker::Plugin;

use strict;
use warnings;
use Tanker::Request;

sub new  ($$)
{
	# standard stuff for creating a new object
	# I'm not sure if this *should* be an object 
	# but I think it'll probably be useful in the end
	my $proto  = shift;
        my $class  = ref($proto) || $proto;

	# yes, we must have a pipeline
	my $pipeline = shift || warn "No pipeline was passed to this plugin : $class\n";
	

	# bless our self into a hash
        my $self  = {};
        bless ($self, $class);

	# load that with the config
	$self->{pipeline} = $pipeline;

	# and give it on back
        return $self;
}

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

} 




1;
__END__