File Coverage

blib/lib/Bryar/Comment.pm
Criterion Covered Total %
statement 27 31 87.1
branch n/a
condition n/a
subroutine 8 10 80.0
pod 3 3 100.0
total 38 44 86.3


line stmt bran cond sub pod time code
1             package Bryar::Comment;
2 2     2   11 use base 'Bryar::Document'; # It sort-of is.
  2         4  
  2         1331  
3 2     2   13 use Time::Piece;
  2         4  
  2         10  
4 2     2   137 use 5.006;
  2         7  
  2         73  
5 2     2   11 use strict;
  2         3  
  2         55  
6 2     2   10 use warnings;
  2         6  
  2         46  
7 2     2   10 use Carp;
  2         4  
  2         199  
8             our $VERSION = '1.1';
9              
10             =head1 NAME
11              
12             Bryar::Comment - Represents a comment on a blog post
13              
14             =head1 SYNOPSIS
15              
16             $self->new(...);
17              
18             $self->content(); # Get (clean version of) content
19             $self->epoch(); # Get epoch
20             $self->timepiece(); # Get the date as a Time::Piece object
21             $self->author(); # Get author
22             $self->url(); # Get author URL
23             $self->id # ID of blog document this is attached to
24              
25             =head1 DESCRIPTION
26              
27             This encapsulates a comment on a particular blog posting. Inherits
28             from L for convenience.
29              
30             =head1 METHODS
31              
32             =head2 new
33              
34             $self->new(%params)
35              
36             Creates a new Bryar::Comment instance.
37              
38             =cut
39              
40              
41             sub new {
42 28     28 1 37 my $class = shift;
43 28         35 my %args;
44 2     2   11 { no warnings; %args = @_; } # turn off mumbling about uninitialised list
  2         10  
  2         349  
  28         27  
  28         145  
45 28         159 my $self = bless {
46             epoch => $args{epoch} ,
47             content => $args{content} ,
48             author => $args{author} ,
49             url => $args{url} ,
50             id => $args{id},
51             }, $class;
52 28         150 return $self;
53             }
54              
55              
56             =head2 content
57              
58             $self->content(); # Get content
59              
60             Gets the value of the comment's content
61              
62             =cut
63              
64             sub content {
65 0     0 1   my $self = shift;
66             # Tidy content here!
67 0           return $self->{content};
68             }
69              
70             =head2 url
71              
72             $self->url(); # Get url
73              
74             Gets a URL provided by the author.
75              
76             =cut
77              
78             sub url {
79 0     0 1   my $self = shift;
80 0           return $self->{url};
81             }
82              
83             1;
84              
85             =head1 LICENSE
86              
87             This module is free software, and may be distributed under the same
88             terms as Perl itself.
89              
90              
91             =head1 AUTHOR
92              
93             Copyright (C) 2003, Simon Cozens C
94              
95             some parts Copyright 2007 David Cantrell C
96              
97              
98             =head1 SEE ALSO
99              
100             L