lib/MojoX/Route.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 11 | 12 | 91.6 |
branch | 1 | 4 | 25.0 |
condition | 1 | 3 | 33.3 |
subroutine | 3 | 3 | 100.0 |
pod | 1 | 1 | 100.0 |
total | 17 | 23 | 73.9 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package MojoX::Route; | ||||||
2 | 3 | 3 | 2618 | use Mojo::Base -base; | |||
3 | 6 | ||||||
3 | 16 | ||||||
3 | |||||||
4 | 3 | 3 | 398 | use Scalar::Util 'weaken'; | |||
3 | 5 | ||||||
3 | 503 | ||||||
5 | |||||||
6 | has 'app'; | ||||||
7 | |||||||
8 | sub new { | ||||||
9 | 9 | 9 | 1 | 14 | my $class = shift; | ||
10 | |||||||
11 | 9 | 50 | 33 | 17 | if (ref $class && $class->isa(__PACKAGE__)) { | ||
12 | 0 | 0 | 0 | @_ == 1 ? $_[0]->{app} = $class->{app} : push @_, app => $class->{app}; | |||
13 | } | ||||||
14 | |||||||
15 | 9 | 29 | my $self = $class->SUPER::new(@_); | ||||
16 | 9 | 109 | weaken $self->{app}; | ||||
17 | 9 | 10 | return $self; | ||||
18 | } | ||||||
19 | |||||||
20 | 1; | ||||||
21 | |||||||
22 | __END__ |