line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bootylicious::ArticleIteratorFinder; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
436
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
113
|
|
4
|
5
|
|
|
5
|
|
21
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
107
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
22
|
use base 'Mojo::Base'; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
322
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->attr('iterator'); |
9
|
|
|
|
|
|
|
|
10
|
5
|
|
|
5
|
|
1470
|
use Bootylicious::ArticleWithPager; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
25
|
|
11
|
5
|
|
|
5
|
|
413
|
use Bootylicious::IteratorSearchable; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
26
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
11
|
|
|
11
|
1
|
63
|
my $self = shift->SUPER::new(@_); |
15
|
|
|
|
|
|
|
|
16
|
11
|
50
|
|
|
|
99
|
Carp::croak q/Iterator is a required parameter/ unless $self->iterator; |
17
|
|
|
|
|
|
|
|
18
|
11
|
|
|
|
|
100
|
return $self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub find { |
22
|
11
|
|
|
11
|
0
|
25
|
my $self = shift; |
23
|
11
|
|
|
|
|
36
|
my ($year, $month, $name) = @_; |
24
|
|
|
|
|
|
|
|
25
|
11
|
|
|
|
|
34
|
my $iterator = Bootylicious::IteratorSearchable->new($self->iterator); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
return $iterator->find_first( |
28
|
|
|
|
|
|
|
sub { |
29
|
16
|
|
|
16
|
|
71
|
my ($iterator, $elem) = @_; |
30
|
|
|
|
|
|
|
|
31
|
16
|
100
|
|
|
|
53
|
return unless $elem->created->year == $year; |
32
|
15
|
100
|
|
|
|
931
|
return unless $elem->created->month == $month; |
33
|
10
|
100
|
|
|
|
467
|
return unless $elem->name eq $name; |
34
|
|
|
|
|
|
|
|
35
|
9
|
|
|
|
|
39
|
my $prev = $iterator->take_prev; |
36
|
9
|
|
|
|
|
30
|
my $next = $iterator->take_next; |
37
|
|
|
|
|
|
|
|
38
|
9
|
|
|
|
|
103
|
return Bootylicious::ArticleWithPager->new( |
39
|
|
|
|
|
|
|
$elem, |
40
|
|
|
|
|
|
|
prev => $prev, |
41
|
|
|
|
|
|
|
next => $next |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
} |
44
|
11
|
|
|
|
|
76
|
); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |