line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ODS::Table::Column::Boolean; |
2
|
|
|
|
|
|
|
|
3
|
71
|
|
|
71
|
|
423
|
use YAOO; |
|
71
|
|
|
|
|
77
|
|
|
71
|
|
|
|
|
364
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
extends 'ODS::Table::Column::Base'; |
6
|
|
|
|
|
|
|
|
7
|
71
|
|
|
71
|
|
26657
|
use ODS::Utils qw/clone error/; |
|
71
|
|
|
|
|
157
|
|
|
71
|
|
|
|
|
359
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has reference => isa(boolean); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub validation { |
12
|
6844
|
50
|
50
|
6844
|
0
|
80712
|
if (ref($_[1] || "") ne 'SCALAR' || ${$_[1]} !~ m/1|0/) { |
|
6844
|
|
33
|
|
|
47672
|
|
13
|
0
|
|
|
|
|
0
|
croak sprintf "The value passed to the %s column does not match the boolean constraint.", |
14
|
|
|
|
|
|
|
$_[0]->name; |
15
|
|
|
|
|
|
|
} |
16
|
6844
|
|
|
|
|
17936
|
return $_[1]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub inflation { |
20
|
1818
|
|
|
1818
|
0
|
14840
|
my ($self, $value) = @_; |
21
|
1818
|
100
|
|
|
|
5304
|
if (! ref $value) { |
22
|
19
|
|
|
|
|
97
|
$self->reference(\1); |
23
|
19
|
|
|
|
|
799
|
$value = \!!$value; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub deflation { |
28
|
3422
|
|
|
3422
|
0
|
33571
|
my ($self, $value) = @_; |
29
|
3422
|
50
|
33
|
|
|
10502
|
if ($self->reference && ref $value) { |
30
|
0
|
|
|
|
|
0
|
$value = $$value; |
31
|
|
|
|
|
|
|
} |
32
|
3422
|
|
|
|
|
37229
|
return $value; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |