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 | 849565 | use Mojo::Base -base; | |||
5 | 107364 | ||||||
5 | 35 | ||||||
3 | |||||||
4 | 5 | 5 | 877 | use Scalar::Util 'weaken'; | |||
5 | 12 | ||||||
5 | 942 | ||||||
5 | |||||||
6 | has 'app'; | ||||||
7 | |||||||
8 | sub new { | ||||||
9 | 7 | 7 | 1 | 30 | my $class = shift; | ||
10 | |||||||
11 | 7 | 100 | 66 | 31 | if (ref $class && $class->isa(__PACKAGE__)) { | ||
12 | 2 | 100 | 10 | @_ == 1 ? $_[0]->{app} = $class->{app} : push @_, app => $class->{app}; | |||
13 | } | ||||||
14 | |||||||
15 | 7 | 33 | my $self = $class->SUPER::new(@_); | ||||
16 | 7 | 73 | weaken $self->{app}; | ||||
17 | 7 | 25 | return $self; | ||||
18 | } | ||||||
19 | |||||||
20 | 1; | ||||||
21 | |||||||
22 | __END__ |