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   58 use strict;
  13         17  
  13         494  
4 13     13   63 use warnings;
  13         20  
  13         393  
5              
6 13     13   57 use base 'Bootylicious::FileIteratorLoader';
  13         15  
  13         4081  
7              
8             __PACKAGE__->attr(filter => sub {qr/\.comment-(\d+)$/});
9             __PACKAGE__->attr(element_class => 'Bootylicious::Comment');
10              
11             sub load {
12 18     18 0 137 my $iterator = shift->SUPER::load(@_);
13              
14 16         158 $iterator->elements(
15 18         49 [ sort { $a->created->epoch <=> $b->created->epoch }
16 18         32 @{$iterator->elements}
17             ]
18             );
19 18         215 $iterator->rewind;
20              
21 18         100 return $iterator;
22             }
23              
24             1;