Throwable/Role/NoBody.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 3 totaltotal 85.0% 17 / 20 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
body
1.0
body_headers
1.0
CRAP 1.0
« Throwable/Role/Status/Unauthorized.pm ↑ Summary Throwable/Role/TextBody.pm »
1 package HTTP::Throwable::Role::NoBody 0.028;
2 4 our $AUTHORITY = 'cpan:STEVAN';
3  
4 4 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 27 ▶sub body { return }
Subroutine body: called CC=1 SCAR=0.0
Pod undocumented
7  
8 27 ▶sub body_headers {
Subroutine body_headers: called CC=1 SCAR=0.0
Pod undocumented
9 27 my ($self, $body) = @_;
10  
11 return [
12 27 'Content-Length' => 0,
13 ];
14 }
15  
16 55 ▶sub as_string { $_[0]->status_line }
Subroutine as_string: called CC=1 SCAR=0.0
Pod undocumented
17  
18 4 ▶no Moo::Role; 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
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.028
31  
32 =head1 OVERVIEW
33  
34 This is a very simple role, implementing the required C<as_string>, C<body>,
35 and C<body_headers> for L<HTTP::Throwable>.
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 PERL VERSION
42  
43 This library should run on perls released even a long time ago. It should work
44 on any version of perl released in the last five years.
45  
46 Although it may work on older versions of perl, no guarantee is made that the
47 minimum required version will not be increased. The version may be increased
48 for any reason, and there is no promise that patches will be accepted to lower
49 the minimum required perl.
50  
51 =head1 AUTHORS
52  
53 =over 4
54  
55 =item *
56  
57 Stevan Little <stevan.little@iinteractive.com>
58  
59 =item *
60  
61 Ricardo Signes <cpan@semiotic.systems>
62  
63 =back
64  
65 =head1 COPYRIGHT AND LICENSE
66  
67 This software is copyright (c) 2011 by Infinity Interactive, Inc.
68  
69 This is free software; you can redistribute it and/or modify it under
70 the same terms as the Perl 5 programming language system itself.
71  
72 =cut
73  
74 __END__
« Throwable/Role/Status/Unauthorized.pm ↑ Summary Throwable/Role/TextBody.pm »