blib/lib/Bootylicious/PingbackIterator.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 50.0% 1 / 2 totaltotal 97.8% 45 / 46 CC 3 SCAR 4.7
CC
3
Cov
100%
load
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« blib/lib/Bootylicious/Plugin/Model.pm ↑ Summary blib/lib/Bootylicious/Comment.pm »
1 package Bootylicious::PingbackIterator;
2  
3 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 12 ▶use base 'Bootylicious::Iterator';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 12 __PACKAGE__->attr('path');
9  
10 12 ▶use Bootylicious::Pingback;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 12 ▶use Bootylicious::Timestamp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub new {
14 9 ▶ my $self = shift->SUPER::new(@_);
Subroutine new: called CC=1 SCAR=0.0
Pod documented
15  
16 9 return $self->load;
17 }
18  
19 sub load {
20 9 ▶ my $self = shift;
Subroutine load: called CC=3 SCAR=11.0
Pod undocumented
21  
22 9 ▶ open my $fh, '<:encoding(UTF-8)', $self->path or return $self;
Subroutine BEGIN: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<:encoding(UTF-8)", $self->path or return $self 3 6 9
23  
24 6 my @pingbacks;
25 6 ▶ while (my $line = <$fh>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined(my $line = readline $fh)) 6 6 12
26 6 chomp $line;
27  
28 6 my ($created, $source_uri) = split ' ' => $line;
29  
30 6 $created = Bootylicious::Timestamp->new(timestamp => $created);
31  
32 6 push @pingbacks,
33 Bootylicious::Pingback->new(
34 created => $created,
35 source_uri => $source_uri
36 );
37 }
38  
39 6 $self->elements([@pingbacks]);
40  
41 6 return $self;
42 }
43  
44 12 1;
« blib/lib/Bootylicious/Plugin/Model.pm ↑ Summary blib/lib/Bootylicious/Comment.pm »