« blib/lib/Bootylicious/PingbackIterator.pm
↑ Summary
blib/lib/Bootylicious/PingbackIteratorFinder.pm »
| 1 | package Bootylicious::Comment; | ||||||||||
| 2 | |||||||||||
| 3 | 10 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 10 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 10 | ▶ | use base 'Bootylicious::Document'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 10 | ▶ | use Bootylicious::Article; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 10 | ▶ | use Bootylicious::Timestamp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 10 | ▶ | use File::stat; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | sub new { | ||||||||||
| 13 | 30 | ▶ | my $self = shift->SUPER::new; | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 14 | 30 | my %params = @_; | |||||||||
| 15 | |||||||||||
| 16 | 30 | foreach my $method (qw/author email url content/) { | |||||||||
| 17 | 120 | ▶ | $self->$method($params{$method}) if defined $params{$method}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 30 | return $self; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | sub created { | ||||||||||
| 24 | 60 | ▶ | Bootylicious::Timestamp->new(epoch => stat(shift->path)->mtime); | ||||||||
|
Subroutine
created: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 25 | } | ||||||||||
| 26 | 5 | ▶ | sub email { shift->metadata(email => @_) } | ||||||||
|
Subroutine
email: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 27 | 0 | ▶ | sub url { shift->metadata(url =>) } | ||||||||
|
Subroutine
url: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 28 | |||||||||||
| 29 | 10 | ▶ | sub content { shift->inner(content => @_) } | ||||||||
|
Subroutine
content: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 30 | |||||||||||
| 31 | sub number { | ||||||||||
| 32 | 2 | ▶ | my $self = shift; | ||||||||
|
Subroutine
number: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 33 | |||||||||||
| 34 | 2 | my $path = $self->path; | |||||||||
| 35 | |||||||||||
| 36 | 2 | my ($number) = ($path =~ m/-(\d+)$/); | |||||||||
| 37 | |||||||||||
| 38 | 2 | return $number; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | sub article { | ||||||||||
| 42 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
article: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 43 | |||||||||||
| 44 | 0 | my $path = $self->path; | |||||||||
| 45 | 0 | $path =~ s/\.comment-(\d+)$//; | |||||||||
| 46 | |||||||||||
| 47 | 0 | return Bootylicious::Article->new(path => $path); | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 10 | 1; | |||||||||