Throwable/Role/NoBody.pm

filter: Statementstmt 100% 13 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 3 totaltotal 85.7% 18 / 21 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
body
1.0
body_headers
1.0
CRAP 1.0
« Throwable/Role/Generic.pm ↑ Summary Throwable/Role/TextBody.pm »
1 package HTTP::Throwable::Role::NoBody;
2 4 our $AUTHORITY = 'cpan:STEVAN';
3 4 $HTTP::Throwable::Role::NoBody::VERSION = '0.027';
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 sub body_headers {
9 27 ▶ my ($self, $body) = @_;
Subroutine body_headers: called CC=1 SCAR=0.0
Pod undocumented
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.027
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 AUTHORS
42  
43 =over 4
44  
45 =item *
46  
47 Stevan Little <stevan.little@iinteractive.com>
48  
49 =item *
50  
51 Ricardo Signes <rjbs@cpan.org>
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__
« Throwable/Role/Generic.pm ↑ Summary Throwable/Role/TextBody.pm »