| 1 | package Plack::App::Data::Printer; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use base qw(Plack::Component); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 3 | ▶ | use Data::Printer; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 3 | ▶ | use Error::Pure qw(err); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 3 | ▶ | use Plack::Util::Accessor qw(data); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 3 | our $VERSION = 0.04; | |||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | sub call { | ||||||||
|
Subroutine
call: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 14 | 1 | my ($self, $env) = @_; | |||||||||
| 15 | |||||||||||
| 16 | 1 | my $output; | |||||||||
| 17 | 1 | my $data = $self->data; | |||||||||
| 18 | 1 | p $data, 'output' => \$output; | |||||||||
| 19 | |||||||||||
| 20 | return [ | ||||||||||
| 21 | 1 | 200, | |||||||||
| 22 | ['Content-Type' => 'text/plain'], | ||||||||||
| 23 | [$output], | ||||||||||
| 24 | ]; | ||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 2 | ▶ | sub prepare_app { | ||||||||
|
Subroutine
prepare_app: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 28 | 2 | my $self = shift; | |||||||||
| 29 | |||||||||||
| 30 | 2 | ▶ | if (! $self->data) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 1 | err 'No data.'; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 1 | return; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 3 | 1; | |||||||||
| 38 | |||||||||||
| 39 | __END__ | ||||||||||