Factory/Interface/HTML/Widget.pm

filter: Statementstmt 87.5% 14 / 16 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 2 / 2 totaltotal 84.0% 21 / 25 CC 3 SCAR 6.5
CC
3
Cov
80%
render
2.1
consume
2.1
BEGIN
1.0
CRAP 1.9
« Factory/Result/Single.pm ↑ Summary Factory/Result/Gathered.pm »
1 package Form::Factory::Interface::HTML::Widget;
2 1 $Form::Factory::Interface::HTML::Widget::VERSION = '0.022';
3 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 requires qw( render_control consume_control );
6  
7 # ABSTRACT: rendering/consuming HTML controls
8  
9  
10 1 has alternate_renderer => (
11 is => 'rw',
12 isa => 'CodeRef',
13 predicate => 'has_alternate_renderer',
14 );
15  
16  
17 1 has alternate_consumer => (
18 is => 'rw',
19 isa => 'CodeRef',
20 predicate => 'has_alternate_consumer',
21 );
22  
23  
24 6 ▶sub render {
Subroutine render: called CC=2 SCAR=7.6
Pod documented
25 6 my $self = shift;
26  
27 6 ▶ if ($self->has_alternate_renderer) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_alternate_renderer) { } 0 6 6
28 0 return $self->alternate_renderer->($self, @_);
29 }
30 else {
31 6 return $self->render_control(@_);
32 }
33 }
34  
35  
36 528 ▶sub consume {
Subroutine consume: called CC=2 SCAR=7.6
Pod documented
37 528 my $self = shift;
38  
39 528 ▶ if ($self->has_alternate_consumer) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_alternate_consumer) { } 0 528 528
40 0 $self->alternate_consumer->($self, @_);
41 }
42 else {
43 528 $self->consume_control(@_);
44 }
45 }
46  
47  
48 1 1;
49  
50 __END__
« Factory/Result/Single.pm ↑ Summary Factory/Result/Gathered.pm »