File Coverage

blib/lib/Template/EmbeddedPerl/Compiled.pm
Criterion Covered Total %
statement 15 16 93.7
branch 1 2 50.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 21 23 91.3


line stmt bran cond sub pod time code
1             package Template::EmbeddedPerl::Compiled;
2              
3 6     6   39 use warnings;
  6         13  
  6         528  
4 6     6   37 use strict;
  6         10  
  6         278  
5 6     6   3229 use Template::EmbeddedPerl::Utils 'generate_error_message';
  6         21  
  6         1057  
6              
7             sub render {
8 64     64 1 3700 my ($self, @args) = @_;
9 64         109 my $output;
10 64 50       799 eval { $output = $self->{code}->(@args); 1 } or do {
  64         2168  
  64         238  
11 0         0 die generate_error_message($@, $self->{template});
12             };
13 64         242 return $output;
14             }
15              
16             1;
17              
18             =head1 NAME
19              
20             Template::EmbeddedPerl::Compiled - Compiled template
21              
22             =head1 DESCRIPTION
23              
24             This module is used internally by L to represent a compiled template. It is not intended to be used directly.
25              
26             =head1 METHODS
27              
28             =head2 render
29              
30             my $output = $compiled->render(@args);
31              
32             Render the template with the given arguments.
33              
34             =head1 SEE ALSO
35            
36             L
37              
38             =head1 AUTHOR
39            
40             See L
41            
42             =head1 COPYRIGHT & LICENSE
43            
44             See L
45            
46             =cut
47              
48