line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ODS::Table::Column::Boolean; |
2
|
|
|
|
|
|
|
|
3
|
71
|
|
|
71
|
|
436
|
use YAOO; |
|
71
|
|
|
|
|
77
|
|
|
71
|
|
|
|
|
364
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
extends 'ODS::Table::Column::Base'; |
6
|
|
|
|
|
|
|
|
7
|
71
|
|
|
71
|
|
23821
|
use ODS::Utils qw/clone error/; |
|
71
|
|
|
|
|
141
|
|
|
71
|
|
|
|
|
294
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has reference => isa(boolean); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub validation { |
12
|
6847
|
50
|
50
|
6847
|
0
|
78814
|
if (ref($_[1] || "") ne 'SCALAR' || ${$_[1]} !~ m/1|0/) { |
|
6847
|
|
33
|
|
|
45981
|
|
13
|
0
|
|
|
|
|
0
|
croak sprintf "The value passed to the %s column does not match the boolean constraint.", |
14
|
|
|
|
|
|
|
$_[0]->name; |
15
|
|
|
|
|
|
|
} |
16
|
6847
|
|
|
|
|
20011
|
return $_[1]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub inflation { |
20
|
1810
|
|
|
1810
|
0
|
13638
|
my ($self, $value) = @_; |
21
|
1810
|
100
|
|
|
|
5291
|
if (! ref $value) { |
22
|
11
|
|
|
|
|
53
|
$self->reference(\1); |
23
|
11
|
|
|
|
|
548
|
$value = \!!$value; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub deflation { |
28
|
3424
|
|
|
3424
|
0
|
32351
|
my ($self, $value) = @_; |
29
|
3424
|
50
|
33
|
|
|
10094
|
if ($self->reference && ref $value) { |
30
|
0
|
|
|
|
|
0
|
$value = $$value; |
31
|
|
|
|
|
|
|
} |
32
|
3424
|
|
|
|
|
40722
|
return $value; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |