line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Paging; |
2
|
1
|
|
|
1
|
|
33921
|
use common::sense; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
3
|
1
|
|
|
1
|
|
59
|
use 5.008008; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
58
|
|
4
|
1
|
|
|
1
|
|
904
|
use UNIVERSAL::require; |
|
1
|
|
|
|
|
2030
|
|
|
1
|
|
|
|
|
12
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Class::Accessor::Lite ( |
9
|
1
|
|
|
|
|
7
|
new => 0, |
10
|
|
|
|
|
|
|
rw => [qw/collection/], |
11
|
1
|
|
|
1
|
|
1124
|
); |
|
1
|
|
|
|
|
1369
|
|
12
|
1
|
|
|
1
|
|
75
|
use Carp qw/croak/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
13
|
1
|
|
|
1
|
|
583
|
use Data::Paging::Collection; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
16
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub create { |
16
|
3
|
|
|
3
|
0
|
4874
|
my ($class, $collection_param, $renderer_name) = @_; |
17
|
3
|
|
|
|
|
27
|
my $collection = Data::Paging::Collection->new(%$collection_param); |
18
|
3
|
50
|
|
|
|
17
|
$collection->renderer($class->_create_renderer($renderer_name)) if $renderer_name; |
19
|
2
|
|
|
|
|
39
|
$collection; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _create_renderer { |
23
|
3
|
|
|
3
|
|
6
|
my ($class, $renderer_name) = @_; |
24
|
3
|
|
|
|
|
11
|
my $package = $class->_load_renderer($renderer_name); |
25
|
2
|
|
|
|
|
13
|
$package->new; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _load_renderer { |
29
|
3
|
|
|
3
|
|
5
|
my ($class, $name) = @_; |
30
|
3
|
50
|
|
|
|
13
|
croak "no renderer name" unless $name; |
31
|
|
|
|
|
|
|
|
32
|
3
|
|
|
|
|
6
|
my $package = $name; |
33
|
3
|
|
|
|
|
9
|
$package =~ s/\A-/Data::Paging::Renderer::/; |
34
|
3
|
100
|
|
|
|
23
|
$package->require or croak "can't load renderer: $package"; |
35
|
2
|
|
|
|
|
52
|
$package; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
__END__ |