File Coverage

blib/lib/autobox/String/Inflector.pm
Criterion Covered Total %
statement 19 19 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod n/a
total 28 28 100.0


line stmt bran cond sub pod time code
1             package autobox::String::Inflector;
2              
3 2     2   30112 use strict;
  2         4  
  2         66  
4 2     2   10 use warnings;
  2         4  
  2         78  
5             our $VERSION = '0.02';
6              
7 2     2   12 use base qw(autobox);
  2         8  
  2         6253  
8              
9             sub import {
10 2     2   44 shift->SUPER::import(STRING => 'autobox::String::Inflector::Impl', @_);
11             }
12              
13             package # hide from pause
14             autobox::String::Inflector::Impl;
15              
16 2     2   24893 use String::CamelCase qw(camelize decamelize);
  2         1136  
  2         148  
17 2     2   10943 use Lingua::EN::Inflect::Number ();
  2         54511  
  2         296  
18              
19             *pluralize = \&Lingua::EN::Inflect::Number::to_PL;
20              
21             sub singularize {
22 2     2   6881 local $_ = shift;
23 2 100       21 return $_ if s/(alias|status)es$/$1/i;
24 1         7 return Lingua::EN::Inflect::Number::to_S($_);
25             }
26              
27             1;
28             __END__