blib/lib/MojoX/Model.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 12 | 12 | 100.0 |
branch | 4 | 4 | 100.0 |
condition | 2 | 3 | 66.6 |
subroutine | 3 | 3 | 100.0 |
pod | 1 | 1 | 100.0 |
total | 22 | 23 | 95.6 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package MojoX::Model; | ||||||
2 | 5 | 5 | 1098193 | use Mojo::Base -base; | |||
5 | 165322 | ||||||
5 | 29 | ||||||
3 | |||||||
4 | 5 | 5 | 742 | use Scalar::Util 'weaken'; | |||
5 | 17 | ||||||
5 | 1048 | ||||||
5 | |||||||
6 | has 'app'; | ||||||
7 | |||||||
8 | sub new { | ||||||
9 | 7 | 7 | 1 | 18 | my $class = shift; | ||
10 | |||||||
11 | 7 | 100 | 66 | 28 | if (ref $class && $class->isa(__PACKAGE__)) { | ||
12 | 2 | 100 | 10 | @_ == 1 ? $_[0]->{app} = $class->{app} : push @_, app => $class->{app}; | |||
13 | } | ||||||
14 | |||||||
15 | 7 | 25 | my $self = $class->SUPER::new(@_); | ||||
16 | 7 | 64 | weaken $self->{app}; | ||||
17 | 7 | 21 | return $self; | ||||
18 | } | ||||||
19 | |||||||
20 | 1; | ||||||
21 | |||||||
22 | __END__ |