blib/lib/Dancer2/Core/Role/StandardResponses.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 2 / 2 totaltotal 100% 20 / 20 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
response
1.0
CRAP 1.0
« blib/lib/Dancer2/Core/Role/Handler.pm ↑ Summary blib/lib/Dancer2/Logger/Capture/Trap.pm »
1 package Dancer2::Core::Role::StandardResponses;
2 # ABSTRACT: Role to provide commonly used responses
3 162 $Dancer2::Core::Role::StandardResponses::VERSION = '2.2.1';
4 162 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 162 ▶use Dancer2::Core::HTTP;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 sub response {
8 8 ▶ my ( $self, $app, $code, $message ) = @_;
Subroutine response: called CC=1 SCAR=0.0
Pod documented
9 8 $app->response->status($code);
10 8 $app->response->header( 'Content-Type', 'text/plain' );
11 8 return $message;
12 }
13  
14 sub standard_response {
15 7 ▶ my ( $self, $app, $status_code ) = @_;
Subroutine standard_response: called CC=1 SCAR=0.0
Pod documented
16  
17 7 return $self->response(
18 $app,
19 $status_code,
20 Dancer2::Core::HTTP->status_message($status_code),
21 );
22 }
23  
24 162 1;
25  
26 __END__
« blib/lib/Dancer2/Core/Role/Handler.pm ↑ Summary blib/lib/Dancer2/Logger/Capture/Trap.pm »