File Coverage

blib/lib/ODS/Table/Column/Integer.pm
Criterion Covered Total %
statement 10 11 90.9
branch 1 2 50.0
condition 1 3 33.3
subroutine 5 5 100.0
pod 0 3 0.0
total 17 24 70.8


line stmt bran cond sub pod time code
1             package ODS::Table::Column::Integer;
2              
3 70     70   417 use YAOO;
  70         77  
  70         297  
4              
5             extends 'ODS::Table::Column::Base';
6              
7 70     70   24050 use ODS::Utils qw/error/;
  70         78  
  70         439  
8              
9             has auto_increment => rw, isa(boolean);
10              
11             sub validation {
12 3425 50 33 3425 0 41724 if (ref($_[1]) || $_[1] !~ m/\d+/) {
13 0         0 croak sprintf "The value passed to the %s column does not match the integer constraint.",
14             $_[0]->name;
15             }
16 3425         10072 return $_[1];
17             }
18              
19 910     910 0 13044 sub inflation { return 0 + $_[1]; }
20              
21 1713     1713 0 14900 sub deflation { return 0 + $_[1]; }
22              
23             #sub coercion { return $_[1]; }
24              
25             1;
26              
27             __END__