blib/lib/Template/Plugin/Lingua/EN/Fractions.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 SCAR 6.9
CC
2
Cov
97%
_fraction2words
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
↑ Summary
1 package Template::Plugin::Lingua::EN::Fractions;
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.01;
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::Fractions qw( fraction2words );
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 6 $Template::Stash::SCALAR_OPS->{'fraction2words'} = \&_fraction2words;
15  
16 sub new {
17 2 ▶ my ($class, $context, $options) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
18  
19 # now define the filter and return the plugin
20 2 $context->define_filter('fraction2words', \&_fraction2words);
21 2 return bless {}, $class;
22 }
23  
24 sub _fraction2words {
25 4 ▶ my $options = ref $_[-1] eq 'HASH' ? pop : {};
Subroutine _fraction2words: called CC=2 SCAR=7.2
Branch: 1 branch
BranchTrueFalseTotal
ref $_[-1] eq 'HASH' ? : 0 4 4
26 4 return fraction2words(join('', @_));
27 }
28  
29 6 1;
30  
31 __END__
↑ Summary