blib/lib/Lingua/AFR/Numbers.pm

filter: Statementstmt 97.2% 35 / 36 Branchbran 50.0% 2 / 4 Conditioncond 57.1% 4 / 7 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 100% 11 / 11 Podpod 100% 1 / 1 totaltotal 85.7% 54 / 63 CC 6 SCAR 8.0
CC
6
Cov
87%
parse
4.2
new
3.3
BEGIN
1.0
CRAP 2.2
↑ Summary
1 # For Emacs: -*- mode:cperl; eval: (folding-mode 1) -*-
2  
3 package Lingua::AFR::Numbers;
4 # ABSTRACT: This module is deprecated. Please use Lingua::AFR::Num2Word instead.
5  
6 1 ▶use 5.16.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # {{{ use block
11  
12 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Export::Attrs;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Lingua::AFR::Num2Word qw(num2afr_cardinal parse);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 # }}}
17 # {{{ var block
18  
19 1 our $VERSION = '0.2603270';
20  
21 # }}}
22  
23 # {{{ re-export from Num2Word
24  
25 1 ▶sub num2afr_cardinal :Export { goto &Lingua::AFR::Num2Word::num2afr_cardinal }
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine num2afr_cardinal: called CC=1 SCAR=0.0
26  
27 # }}}
28 # {{{ new constructor (deprecated)
29  
30 1 ▶sub new {
Subroutine new: called CC=3 SCAR=12.0
Pod documented
31 1 my $class = shift;
32 1 my $number = shift;
33  
34 1 carp "Lingua::AFR::Numbers is deprecated, use Lingua::AFR::Num2Word instead";
35  
36 1 my $self = bless {}, $class;
37  
38 1 ▶ if (defined $number && $number =~ /^\d+$/) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $number and $number =~ /^\d+$/u) 0 1 1
Condition33%1/3
defined $number and $number =~ /^\d+$/u
!ll&&!rl&&r
100
MC/DC0%0/2
defined $number and $number =~ /^\d+$/u
defined $number $number =~ /^\d+$/u
Truth table33%1/3
A and B
A= defined $numberB= $number =~ /^\d+$/u
ABresult
0X0
100
111
39 0 return $self->parse($number);
40 }
41  
42 1 return $self;
43 }
44  
45 # }}}
46 # {{{ parse delegate to Num2Word (deprecated)
47  
48 4 ▶sub parse :Export {
Subroutine parse: called CC=4 SCAR=14.3
49 4 ▶ my $self = ref($_[0]) ? shift : __PACKAGE__->new();
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 4 0 4
50 4 ▶ my $number = shift // return '';
Condition100%2/2
shift() // (return "")
l!l
31
MC/DC100%1/1
shift() // (return "")
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
51  
52 3 ▶ return num2afr_cardinal($number) // '';
Condition50%1/2
num2afr_cardinal($number) // ""
l!l
20
MC/DC0%0/1
num2afr_cardinal($number) // ""
num2afr_cardinal($number)
Truth table50%1/2
A
A= num2afr_cardinal($number)
Aresult
11
00
53 1 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
54  
55 # }}}
56  
57 1 1;
58  
59 __END__
↑ Summary