File Coverage

blib/lib/Pod/Webserver/Response.pm
Criterion Covered Total %
statement 15 16 93.7
branch n/a
condition n/a
subroutine 6 7 85.7
pod 0 3 0.0
total 21 26 80.7


line stmt bran cond sub pod time code
1             package Pod::Webserver::Response;
2              
3 3     3   18 use strict;
  3         7  
  3         121  
4 3     3   16 use warnings;
  3         6  
  3         741  
5              
6             our $VERSION = '3.09';
7              
8             # ------------------------------------------------
9             # The real methods are setter/getters. We only need the setters.
10              
11             sub AUTOLOAD {
12 4     4   482 my ($attrib) = $Pod::Webserver::Response::AUTOLOAD =~ /([^:]+)$/;
13 4         28 $_[0]->{$attrib} = $_[1];
14              
15             } # End of AUTOLOAD.
16              
17             # ------------------------------------------------
18             # The real method is a setter/getter. We only need the getter.
19              
20             sub content_ref {
21 1     1 0 4 my $self = shift;
22 1         7 return \$self->{content};
23              
24             } # End of content_ref.
25              
26             # ------------------------------------------------
27              
28 0     0   0 sub DESTROY {};
29              
30             # ------------------------------------------------
31              
32             sub header {
33 3     3 0 8 my $self = shift;
34 3         6 push @{$self->{header}}, @_;
  3         19  
35              
36             } # End of header.
37              
38             # ------------------------------------------------
39              
40             sub new {
41 2     2 0 10 my ($class, $status_code) = @_;
42              
43 2         26 return bless {code=>$status_code}, $class;
44              
45             } # End of new.
46              
47             # ------------------------------------------------
48              
49             1;