Plagger/Rule.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 36 CC 2 SCAR 11.5
CC
2
Cov
0%
new
6.0
init
2.0
id
2.0
CRAP 3.1
1 package Plagger::Rule;
2 use strict;
3 use UNIVERSAL::require;
4  
5 sub new {
6 my($class, $config) = @_;
7  
8 if (my $exp = $config->{expression}) {
9 $config->{module} = 'Expression';
10 }
11  
12 my $module = delete $config->{module};
13 $module = "Plagger::Rule::$module";
14 $module->require or die $@;
15  
16 my $self = bless {%$config}, $module;
17 $self->init();
18 $self;
19 }
20  
21 sub init { }
22  
23 sub id {
24 my $self = shift;
25 "xxx";
26 }
27  
28 sub as_title {
29 my $self = shift;
30 "xxx";
31 }
32  
33 1;