| 1 | package Tanker::Plugin; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use Tanker::Request; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | sub new ($$) | ||||||||||||||||||||
| 8 | 1 | ▶ | { | ||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.4
Pod
undocumented
| |||||||||||||||||||||
| 9 | # standard stuff for creating a new object | ||||||||||||||||||||
| 10 | # I'm not sure if this *should* be an object | ||||||||||||||||||||
| 11 | # but I think it'll probably be useful in the end | ||||||||||||||||||||
| 12 | 1 | my $proto = shift; | |||||||||||||||||||
| 13 | 1 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | # yes, we must have a pipeline | ||||||||||||||||||||
| 16 | 1 | ▶ | my $pipeline = shift || warn "No pipeline was passed to this plugin : $class\n"; | ||||||||||||||||||
|
Condition50%1/2
shift() || warn("No pipeline was passed to this plugin : $class\n")
MC/DC0%0/1
shift() || warn("No pipeline was passed to this plugin : $class\n")
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | # bless our self into a hash | ||||||||||||||||||||
| 20 | 1 | my $self = {}; | |||||||||||||||||||
| 21 | 1 | bless ($self, $class); | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | # load that with the config | ||||||||||||||||||||
| 24 | 1 | $self->{pipeline} = $pipeline; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | # and give it on back | ||||||||||||||||||||
| 27 | 1 | return $self; | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | sub handle ($$) | ||||||||||||||||||||
| 31 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
handle: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 32 | 0 | my ($self, $request) = @_; | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 1 | 1; | |||||||||||||||||||
| 40 | __END__ | ||||||||||||||||||||