| 1 | package Gears::Router::Pattern::Match; | ||||||||||
| 2 | 1 | $Gears::Router::Pattern::Match::VERSION = '0.105'; | |||||||||
| 3 | 1 | ▶ | use v5.40; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Mooish::Base -standard; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | extends 'Gears::Router::Pattern'; | |||||||||
| 7 | |||||||||||
| 8 | 242 | ▶ | sub compare ($self, $request_path) | ||||||||
|
Subroutine
compare: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||
| 9 | { | ||||||||||
| 10 | 242 | my $pattern = $self->pattern; | |||||||||
| 11 | 242 | my $separator = $self->location->router->pattern_separator; | |||||||||
| 12 | |||||||||||
| 13 | 242 | ▶ | if ($self->is_bridge) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | return undef | ||||||||||
| 15 | 208 | ▶ | unless scalar $request_path =~ m/^\Q$pattern\E(\Q$separator\E|$)/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | } | ||||||||||
| 17 | else { | ||||||||||
| 18 | return undef | ||||||||||
| 19 | 34 | ▶ | unless $request_path eq $pattern; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | # this pattern does not really match anything other than the pattern itself | ||||||||||
| 23 | # - return empty (but defined) list of matches | ||||||||||
| 24 | 212 | return []; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 1 | ▶ | sub build ($self, @more_args) | ||||||||
|
Subroutine
build: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 28 | { | ||||||||||
| 29 | 1 | return $self->pattern; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||