| 1 | package Plack::ResponseHelper::Text; | ||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||
| 5 | 1 | ▶ | use Encode qw/encode/; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 6 | 1 | ▶ | use Plack::Response; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||
| 8 | 1 | ▶ | sub helper { | ||||||||||||||||||||||
|
Subroutine
helper: called CC=5 SCAR=17.1
Pod
undocumented
| |||||||||||||||||||||||||
| 9 | 1 | my $init = shift; | |||||||||||||||||||||||
| 10 | 1 | ▶ | my $content_type = $init && $init->{content_type} || 'text/plain'; | ||||||||||||||||||||||
|
Condition40%2/5
$init && $init->{'content_type'} || 'text/plain'
$init and $init->{"content_type"}
MC/DC0%0/2
$init && $init->{'content_type'} || 'text/plain'
$init
$init->{"content_type"}
Truth table33%1/3
A and B
A= $initB= $init->{"content_type"}
| |||||||||||||||||||||||||
| 11 | 1 | ▶ | my $encoding = $init && $init->{encoding} || 'utf-8'; | ||||||||||||||||||||||
|
Condition40%2/5
$init && $init->{'encoding'} || 'utf-8'
$init and $init->{"encoding"}
MC/DC0%0/2
$init && $init->{'encoding'} || 'utf-8'
$init
$init->{"encoding"}
Truth table33%1/3
A and B
A= $initB= $init->{"encoding"}
| |||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||
| 13 | 2 | ▶ | return sub { | ||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||
| 14 | 2 | my $r = shift; | |||||||||||||||||||||||
| 15 | 2 | my $response = Plack::Response->new(200); | |||||||||||||||||||||||
| 16 | 2 | $response->content_type($content_type); | |||||||||||||||||||||||
| 17 | 2 | ▶ | $response->body(ref $r eq 'ARRAY' ? [map {encode $encoding, $_} @$r] : encode $encoding, $r); | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 18 | 2 | return $response; | |||||||||||||||||||||||
| 19 | 1 | }; | |||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||
| 22 | 1 | 1; | |||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||
| 24 | __END__ | ||||||||||||||||||||||||