blib/lib/Template/Plugin/Lingua/EN/NameCase.pm

filter: Statementstmt 100% 29 / 29 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 97.5% 40 / 41 CC 2 SCAR 1.9
CC
2
Cov
97%
_nc
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
↑ Summary
1 package Template::Plugin::Lingua::EN::NameCase;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 $VERSION = 0.02;
8  
9 6 ▶use base qw(Template::Plugin);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use Template::Plugin;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 6 ▶use Template::Stash;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 6 ▶use Lingua::EN::NameCase qw( nc );
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 6 $Template::Stash::SCALAR_OPS->{'nc'} = \&_nc;
15  
16 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
17 2 my ($class, $context, $options) = @_;
18  
19 # now define the filter and return the plugin
20 2 $context->define_filter('nc', \&_nc);
21 2 return bless {}, $class;
22 }
23  
24 4 ▶sub _nc {
Subroutine _nc: called CC=2 SCAR=7.2
25 4 ▶ my $options = ref $_[-1] eq 'HASH' ? pop : {};
Branch: 1 branch
BranchTrueFalseTotal
ref $_[-1] eq 'HASH' ? : 0 4 4
26 4 return nc(join('', @_));
27 }
28  
29 6 1;
30  
31 __END__
↑ Summary