blib/lib/Thunderhorse/Module/Template.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 100% 29 / 29 CC 2 SCAR 2.2
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Thunderhorse/Message.pm ↑ Summary blib/lib/Gears/X/Thunderhorse.pm »
1 package Thunderhorse::Module::Template;
2 4 $Thunderhorse::Module::Template::VERSION = '0.107';
3 4 ▶use v5.40;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Mooish::Base -standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use Gears::X::Thunderhorse;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use Gears::Template::TT;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 extends 'Thunderhorse::Module';
10  
11 4 has field 'template' => (
12 isa => InstanceOf ['Gears::Template'],
13 lazy => 1,
14 );
15  
16 4 ▶sub _build_template ($self)
Subroutine _build_template: called CC=1 SCAR=0.0
17 {
18 4 my $config = $self->config;
19  
20 4 return Gears::Template::TT->new($config->%*);
21 }
22  
23 4 ▶sub build ($self)
Subroutine build: called CC=1 SCAR=0.0
Pod documented
24 {
25 4 weaken $self;
26 4 my $tpl = $self->template;
27  
28 7 $self->add_method(
29 7 ▶ controller => template => sub ($controller, $template, $vars = {}) {
Subroutine __ANON__: called CC=2 SCAR=6.9
30 7 return $tpl->process($template, $vars);
31 }
32 4 );
33 }
34  
35 __END__
« blib/lib/Thunderhorse/Message.pm ↑ Summary blib/lib/Gears/X/Thunderhorse.pm »