Stream/CallBack.pm

filter: Statementstmt 100% 47 / 47 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 20 / 20 Podpod 75.0% 6 / 8 totaltotal 97.3% 73 / 75 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Stream/Iterator/Consolidate/Result.pm ↑ Summary Stream/Constants.pm »
1 package Data::Range::Compare::Stream::CallBack;
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 base qw(Data::Range::Compare::Stream Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use constant NEW_FROM_CLASS=>'Data::Range::Compare::Stream::CallBack';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use constant HELPER=>0;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use constant RANGE_START =>1;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use constant RANGE_END =>2;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use constant RANGE_DATA =>3;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 use overload
15 1 ▶ '""'=>\&to_string,
Subroutine BEGIN: called CC=1 SCAR=0.0
16 bool=>\&boolean,
17 1 fallback=>1;
18  
19 # global happy helper
20 our %HELPER=(
21 55 ▶ sub_one=>sub { $_[0] - 1 },
Subroutine __ANON__: called CC=1 SCAR=0.0
22 26 ▶ add_one=>sub { $_[0] + 1 },
Subroutine __ANON__: called CC=1 SCAR=0.0
23 929 ▶ cmp_values=>sub { $_[0] <=> $_[1] },
Subroutine __ANON__: called CC=1 SCAR=0.0
24 1 );
25  
26 1 our @EXPORT_OK=qw(%HELPER);
27  
28 14 ▶sub to_string { $_[0]->SUPER::to_string }
Subroutine to_string: called CC=1 SCAR=0.0
Pod documented
29  
30 1150 ▶sub get_helper { $_[0]->[$_[0]->HELPER] }
Subroutine get_helper: called CC=1 SCAR=0.0
Pod undocumented
31  
32 6 ▶sub boolean { $_[0]->SUPER::boolean }
Subroutine boolean: called CC=1 SCAR=0.0
Pod undocumented
33  
34 137 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
35 137 my ($class,@args)=@_;
36 137 return bless [@args],$class;
37 }
38  
39 128 ▶sub factory {
Subroutine factory: called CC=1 SCAR=0.0
Pod documented
40 128 my ($self,@args)=@_;
41 128 my $new=$self->NEW_FROM_CLASS->new($self->get_helper,@args);
42 128 return $new;
43 }
44  
45 57 ▶sub sub_one {
Subroutine sub_one: called CC=1 SCAR=0.0
Pod documented
46 57 my ($self,$value)=@_;
47 57 return $self->get_helper->{sub_one}->($value);
48 }
49  
50 28 ▶sub add_one {
Subroutine add_one: called CC=1 SCAR=0.0
Pod documented
51 28 my ($self,$value)=@_;
52 28 return $self->get_helper->{add_one}->($value);
53 }
54  
55 937 ▶sub cmp_values {
Subroutine cmp_values: called CC=1 SCAR=0.0
Pod documented
56 937 my ($self,$value_a,$value_b)=@_;
57 937 return $self->get_helper->{cmp_values}->($value_a,$value_b);
58 }
59  
60 1 1;
« Stream/Iterator/Consolidate/Result.pm ↑ Summary Stream/Constants.pm »