File Coverage

blib/lib/Rope/Handles/Number.pm
Criterion Covered Total %
statement 20 32 62.5
branch 0 4 0.0
condition n/a
subroutine 7 12 58.3
pod 9 10 90.0
total 36 58 62.0


line stmt bran cond sub pod time code
1             package Rope::Handles::Number;
2              
3 1     1   131941 use strict;
  1         2  
  1         55  
4 1     1   11 use warnings;
  1         2  
  1         458  
5              
6             sub new {
7 1     1 0 228649 my ($class, $str) = @_;
8 1         8 bless \$str, __PACKAGE__;
9             }
10              
11 1     1 1 5 sub add { ${$_[0]} = ${$_[0]} + $_[1] }
  1         9  
  1         6  
12            
13 1     1 1 2 sub subtract { ${$_[0]} = ${$_[0]} - $_[1] }
  1         6  
  1         3  
14            
15 1     1 1 2 sub multiply { ${$_[0]} = ${$_[0]} * $_[1] }
  1         7  
  1         3  
16            
17 1     1 1 6 sub divide { ${$_[0]} = ${$_[0]} / $_[1] }
  1         6  
  1         6  
18            
19 0     0 1   sub modulus { ${$_[0]} = ${$_[0]} % $_[1] }
  0            
  0            
20            
21 0     0 1   sub absolute { ${$_[0]} = abs(${$_[0]}) }
  0            
  0            
22              
23 0 0   0 1   sub increment { ${$_[0]} += ($_[1] ? $_[1] : 1) }
  0            
24            
25 0 0   0 1   sub decrement { ${$_[0]} -= ($_[1] ? $_[1] : 1) }
  0            
26              
27 0     0 1   sub clear { ${$_[0]} = 0 }
  0            
28              
29             1;
30              
31             __END__