line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Teng::Plugin::ResultSet; |
2
|
1
|
|
|
1
|
|
701
|
use 5.008001; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
12
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
8881
|
use Class::Load; |
|
1
|
|
|
|
|
37941
|
|
|
1
|
|
|
|
|
62
|
|
9
|
1
|
|
|
1
|
|
974
|
use String::CamelCase qw/decamelize/; |
|
1
|
|
|
|
|
599
|
|
|
1
|
|
|
|
|
73
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
592
|
use Teng::ResultSet; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
143
|
|
12
|
|
|
|
|
|
|
our @EXPORT = qw/resultset/; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
my %_CACHE; |
16
|
|
|
|
|
|
|
sub resultset { |
17
|
0
|
|
|
0
|
1
|
|
my ($self, $table_name) = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
$table_name = decamelize $table_name; |
20
|
0
|
|
|
|
|
|
my $teng_class = ref $self; |
21
|
0
|
|
0
|
|
|
|
my $result_set_class = $_CACHE{$teng_class} ||= do { |
22
|
0
|
|
|
|
|
|
my $rs_class = "$teng_class\::ResultSet"; |
23
|
0
|
0
|
|
|
|
|
Class::Load::load_optional_class($rs_class) or do { |
24
|
|
|
|
|
|
|
# make result_class class automatically |
25
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; @{"$rs_class\::ISA"} = ('Teng::ResultSet'); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
104
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
}; |
27
|
0
|
|
|
|
|
|
$rs_class; |
28
|
|
|
|
|
|
|
}; |
29
|
0
|
|
|
|
|
|
$result_set_class->new(teng => $self, table_name => $table_name); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
__END__ |