| 1 | package Thunderhorse::Request; | ||||||||||||||||||||
| 2 | 24 | $Thunderhorse::Request::VERSION = '0.107'; | |||||||||||||||||||
| 3 | 24 | ▶ | use v5.40; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 24 | ▶ | use Mooish::Base -standard; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 24 | ▶ | use Future::AsyncAwait; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 24 | ▶ | use Gears::X::Thunderhorse; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 24 | ▶ | use List::Util qw(mesh); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 24 | extends 'PAGI::Request'; | |||||||||||||||||||
| 11 | 24 | with 'Thunderhorse::Message'; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 106 | ▶ | sub FOREIGNBUILDARGS ($class, %args) | ||||||||||||||||||
|
Subroutine
FOREIGNBUILDARGS: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||
| 14 | { | ||||||||||||||||||||
| 15 | Gears::X::Thunderhorse->raise('no context for response') | ||||||||||||||||||||
| 16 | 106 | ▶ | unless $args{context}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 106 | return $args{context}->pagi->@[0, 1]; | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 106 | ▶ | sub update ($self, $scope, $receive, $send) | ||||||||||||||||||
|
Subroutine
update: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 22 | { | ||||||||||||||||||||
| 23 | 106 | $self->{scope} = $scope; | |||||||||||||||||||
| 24 | 106 | $self->{receive} = $receive; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | # handling next match, so make sure path_params are invalidated | ||||||||||||||||||||
| 27 | 106 | delete $self->{path_params}; | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 6 | ▶ | sub path_params ($self) | ||||||||||||||||||
|
Subroutine
path_params: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||
| 31 | { | ||||||||||||||||||||
| 32 | 6 | ▶ | return $self->{path_params} //= do { | ||||||||||||||||||
|
Condition66%2/3
$self->{"path_params"} //= do {
my $ctx = $self->context;
my $match = $ctx->match;
$match = $match->[0] if ref $match eq "ARRAY";
my $pattern = $match->location->pattern_obj;
my $matched = $match->matched;
+{mesh([map({$_->{"label"};} @{$pattern->tokens})], $matched)}
}
MC/DC0%0/2
$self->{"path_params"} //= do {
my $ctx = $self->context;
my $match = $ctx->match;
$match = $match->[0] if ref $match eq "ARRAY";
my $pattern = $match->location->pattern_obj;
my $matched = $match->matched;
+{mesh([map({$_->{"label"};} @{$pattern->tokens})], $matched)}
}
$self->{"path_params"}
do {
my $ctx = $self->context;
my $match = $ctx->match;
$match = $match->[0] if ref $match eq "ARRAY";
my $pattern = $match->location->pattern_obj;
my $matched = $match->matched;
+{mesh([map({$_->{"label"};} @{$pattern->tokens})], $matched)}
}
Truth table66%2/3
A //= B
A= $self->{"path_params"}B= do {
my $ctx = $self->context;
my $match = $ctx->match;
$match = $match->[0] if ref $match eq "ARRAY";
my $pattern = $match->location->pattern_obj;
my $matched = $match->matched;
+{mesh([map({$_->{"label"};} @{$pattern->tokens})], $matched)}
}
| |||||||||||||||||||||
| 33 | 2 | my $ctx = $self->context; | |||||||||||||||||||
| 34 | 2 | my $match = $ctx->match; | |||||||||||||||||||
| 35 | 2 | ▶ | $match = $match->[0] | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 36 | if ref $match eq 'ARRAY'; | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 2 | my $pattern = $match->location->pattern_obj; | |||||||||||||||||||
| 39 | 2 | my $matched = $match->matched; | |||||||||||||||||||
| 40 | 2 | +{mesh [map { $_->{label} } $pattern->tokens->@*], $matched}; | |||||||||||||||||||
| 41 | }; | ||||||||||||||||||||
| 42 | } | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||