App/Presenter.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 25 CC 2 SCAR 13.9
CC
2
Cov
0%
init
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package Web::App::Presenter;
2  
3 use strict;
4  
5 use Web::App;
6  
7 1;
8  
9 sub init {
10 my $class = shift;
11 my $params = shift || {};
12
13 bless $params, $class;
14
15 my $app = Web::App->app;
16
17 my $type = ($params->{'type'} =~ /^presenter:(.*)/)[0];
18
19 $app->config->int->{'presenters'}->{$type} = $params;
20
21 if ($params->can ('_init')) {
22 $params->_init;
23 }
24
25 return $params;
26 }