Gears/Router/Proto.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 94.7% 18 / 19 CC 2 SCAR 3.4
CC
2
Cov
100%
add
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« Gears/Component.pm ↑ Summary Gears/X/HTTP.pm »
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  
« Gears/Component.pm ↑ Summary Gears/X/HTTP.pm »