Ninja/Attack0Functor.pm untested

filter: Statementstmt 0.0% 0 / 7 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 13 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
setMethod
2.0
do
2.0
CRAP 2.0
1 ### override this class as an Attacking functor
2  
3 ### $subroutine is a function reference
4  
5 sub new {
6 my ($class, $subroutine) = @_;
7  
8 $self = { fref => $subroutine, };
9  
10 bless $self, $class;
11 };
12  
13 sub setMethod {
14 my ($self, $f) = @_;
15  
16 $self->{fref} = $f;
17 };
18  
19 sub do {
20 my ($self, @args) = @_;
21  
22 $self->{ref}(@args);
23 }
24  
25 1;