blib/lib/DTL/Fast/Tag/Dump.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 94.2% 33 / 35 SCAR 11.0
CC
3
Cov
100%
parse_parameters
2.0
render
2.0
BEGIN
1.0
CRAP 3.0
« blib/lib/DTL/Fast/Tag/Firstof.pm ↑ Summary blib/lib/DTL/Fast/Tag/Firstofdefined.pm »
1 package DTL::Fast::Tag::Dump;
2 4 ▶use strict; use utf8; use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use parent 'DTL::Fast::Tag::Simple';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 $DTL::Fast::TAG_HANDLERS{'dump'} = __PACKAGE__;
6  
7 #@Override
8 sub parse_parameters
9 {
10 21 ▶ my $self = shift;
Subroutine parse_parameters: called CC=2 SCAR=6.9
Pod undocumented
11
12 21 ▶ die $self->get_parse_error("no variable specified for dumping") unless $self->{'parameter'};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"parameter"} 3 18 21
13 18 $self->{'variables'} = $self->parse_sources($self->{'parameter'});
14
15 18 return $self;
16 }
17  
18 #@Override
19 sub render
20 {
21 18 ▶ my ($self, $context) = @_;
Subroutine render: called CC=2 SCAR=6.9
Pod undocumented
22  
23 18 require Data::Dumper;
24 18 my @result = ();
25 18 foreach my $variable (@{$self->{'variables'}})
26 {
27 push @result,
28 Data::Dumper->Dump(
29 [$variable->render($context, 'safe')],
30 21 ['context.'.$variable->{'original'}]
31 )
32 ;
33 }
34
35 18 return join "\n", @result;
36 }
37  
38 4 1;
« blib/lib/DTL/Fast/Tag/Firstof.pm ↑ Summary blib/lib/DTL/Fast/Tag/Firstofdefined.pm »