| 1 | package Gears::Router::Proto; | ||
| 2 | 4 | $Gears::Router::Proto::VERSION = '0.103'; | |
| 3 | 4 | ▶ | use v5.40; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use Mooish::Base -standard, -role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 4 | requires qw( | |
| 7 | pattern | ||
| 8 | ); | ||
| 9 | |||
| 10 | 4 | has param 'router' => ( | |
| 11 | isa => InstanceOf ['Gears::Router'], | ||
| 12 | weak_ref => 1, | ||
| 13 | ); | ||
| 14 | |||
| 15 | has field 'locations' => ( | ||
| 16 | isa => ArrayRef [InstanceOf ['Gears::Router::Location']], | ||
| 17 | 152 | ▶ | default => sub { [] }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 18 | 4 | ); | |
| 19 | |||
| 20 | sub add ($self, $pattern, $data = {}) | ||
| 21 | 148 | ▶ | { |
|
Subroutine
add: called CC=2 SCAR=6.9
Pod
undocumented
| |||
| 22 | 148 | my $location = $self->router->_build_location( | |
| 23 | $data->%*, | ||
| 24 | router => $self->router, | ||
| 25 | pattern => $self->pattern . $pattern, | ||
| 26 | ); | ||
| 27 | |||
| 28 | 148 | push $self->locations->@*, $location; | |
| 29 | 148 | return $location; | |
| 30 | } | ||
| 31 | |||