line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::DBI::Plugin::TimePiece; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
29844
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
5
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
107
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
4
|
use vars '$VERSION'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
77
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.01'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import { |
12
|
1
|
|
|
1
|
|
8
|
my $class = shift; |
13
|
1
|
|
|
|
|
3
|
my $pkg = caller(0); |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
184
|
|
16
|
1
|
|
|
|
|
6
|
*{"$pkg\::has_a_timepiece"} = sub { |
17
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
18
|
0
|
|
|
|
|
0
|
my $colum = shift; |
19
|
0
|
|
|
|
|
0
|
my $format = shift; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$self->has_a( |
22
|
|
|
|
|
|
|
$colum => 'Time::Piece', |
23
|
0
|
|
|
0
|
|
0
|
inflate => sub { Time::Piece->strptime(shift , $format ) }, |
24
|
0
|
|
|
0
|
|
0
|
deflate => sub { shift->strftime($format) }, |
25
|
0
|
|
|
|
|
0
|
); |
26
|
1
|
|
|
|
|
5
|
}; |
27
|
1
|
|
|
|
|
1
|
*{"$pkg\::has_a_tp"} = *{"$pkg\::has_a_timepiece"}; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
3
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
__END__ |