File Coverage

blib/lib/HTTP/Throwable/Role/NoBody.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 3 0.0
total 15 18 83.3


line stmt bran cond sub pod time code
1             package HTTP::Throwable::Role::NoBody;
2             our $AUTHORITY = 'cpan:STEVAN';
3             $HTTP::Throwable::Role::NoBody::VERSION = '0.026';
4 4     4   3315 use Moo::Role;
  4         8  
  4         32  
5              
6 27     27 0 80 sub body { return }
7              
8             sub body_headers {
9 27     27 0 60 my ($self, $body) = @_;
10              
11             return [
12 27         126 'Content-Length' => 0,
13             ];
14             }
15              
16 55     55 0 19712 sub as_string { $_[0]->status_line }
17              
18 4     4   1617 no Moo::Role; 1;
  4         8  
  4         18  
19              
20             =pod
21              
22             =encoding UTF-8
23              
24             =head1 NAME
25              
26             HTTP::Throwable::Role::NoBody - an exception with no body
27              
28             =head1 VERSION
29              
30             version 0.026
31              
32             =head1 OVERVIEW
33              
34             This is a very simple role, implementing the required C, C,
35             and C for L.
36              
37             When an HTTP::Throwable exception uses this role, its PSGI response will have
38             no entity body. It will report a Content-Length of zero. It will stringify to
39             its status line.
40              
41             =head1 AUTHORS
42              
43             =over 4
44              
45             =item *
46              
47             Stevan Little
48              
49             =item *
50              
51             Ricardo Signes
52              
53             =back
54              
55             =head1 COPYRIGHT AND LICENSE
56              
57             This software is copyright (c) 2011 by Infinity Interactive, Inc..
58              
59             This is free software; you can redistribute it and/or modify it under
60             the same terms as the Perl 5 programming language system itself.
61              
62             =cut
63              
64             __END__