File Coverage

blib/lib/Bootylicious/CommentIteratorLoader.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package Bootylicious::CommentIteratorLoader;
2              
3 13     13   43 use strict;
  13         15  
  13         287  
4 13     13   45 use warnings;
  13         14  
  13         280  
5              
6 13     13   42 use base 'Bootylicious::FileIteratorLoader';
  13         13  
  13         3332  
7              
8             __PACKAGE__->attr(filter => sub {qr/\.comment-(\d+)$/});
9             __PACKAGE__->attr(element_class => 'Bootylicious::Comment');
10              
11             sub load {
12 18     18 0 83 my $iterator = shift->SUPER::load(@_);
13              
14             $iterator->elements(
15 16         94 [ sort { $a->created->epoch <=> $b->created->epoch }
16 18         22 @{$iterator->elements}
  18         34  
17             ]
18             );
19 18         161 $iterator->rewind;
20              
21 18         51 return $iterator;
22             }
23              
24             1;