| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Template::Plugin::Lingua::EN::Fractions; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 6 |  |  | 6 |  | 131185 | use strict; | 
|  | 6 |  |  |  |  | 11 |  | 
|  | 6 |  |  |  |  | 195 |  | 
| 4 | 6 |  |  | 6 |  | 21 | use warnings; | 
|  | 6 |  |  |  |  | 8 |  | 
|  | 6 |  |  |  |  | 170 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 6 |  |  | 6 |  | 24 | use vars qw($VERSION); | 
|  | 6 |  |  |  |  | 11 |  | 
|  | 6 |  |  |  |  | 349 |  | 
| 7 |  |  |  |  |  |  | $VERSION = 0.02; | 
| 8 |  |  |  |  |  |  |  | 
| 9 | 6 |  |  | 6 |  | 27 | use base qw(Template::Plugin); | 
|  | 6 |  |  |  |  | 13 |  | 
|  | 6 |  |  |  |  | 3113 |  | 
| 10 | 6 |  |  | 6 |  | 22016 | use Template::Plugin; | 
|  | 6 |  |  |  |  | 9 |  | 
|  | 6 |  |  |  |  | 112 |  | 
| 11 | 6 |  |  | 6 |  | 3528 | use Template::Stash; | 
|  | 6 |  |  |  |  | 67315 |  | 
|  | 6 |  |  |  |  | 191 |  | 
| 12 | 6 |  |  | 6 |  | 2873 | use Lingua::EN::Fractions qw( fraction2words ); | 
|  | 6 |  |  |  |  | 24267 |  | 
|  | 6 |  |  |  |  | 956 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | $Template::Stash::SCALAR_OPS->{'fraction2words'} = \&_fraction2words; | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | sub new { | 
| 17 | 2 |  |  | 2 | 1 | 4054 | my ($class, $context, $options) = @_; | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | # now define the filter and return the plugin | 
| 20 | 2 |  |  |  |  | 7 | $context->define_filter('fraction2words', \&_fraction2words); | 
| 21 | 2 |  |  |  |  | 36 | return bless {}, $class; | 
| 22 |  |  |  |  |  |  | } | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | sub _fraction2words { | 
| 25 | 4 | 50 |  | 4 |  | 228 | my $options = ref $_[-1] eq 'HASH' ? pop : {}; | 
| 26 | 4 |  |  |  |  | 12 | return fraction2words(join('', @_)); | 
| 27 |  |  |  |  |  |  | } | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | 1; | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  | __END__ |