blib/lib/Tak/WeakClient.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 3 | 7 | 42.8 |
branch | 0 | 2 | 0.0 |
condition | n/a | ||
subroutine | 1 | 2 | 50.0 |
pod | 0 | 1 | 0.0 |
total | 4 | 12 | 33.3 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Tak::WeakClient; | ||||||
2 | |||||||
3 | 1 | 1 | 5 | use Moo; | |||
1 | 2 | ||||||
1 | 8 | ||||||
4 | |||||||
5 | extends 'Tak::Client'; | ||||||
6 | |||||||
7 | has service => (is => 'ro', required => 1, weak_ref => 1); | ||||||
8 | |||||||
9 | sub clone_or_self { | ||||||
10 | 0 | 0 | 0 | my ($self) = @_; | |||
11 | 0 | my $new = $self->service->clone_or_self; | |||||
12 | ($new ne $self->service | ||||||
13 | ? 'Tak::Client' | ||||||
14 | 0 | 0 | : ref($self))->new(service => $new, curried => [ @{$self->curried} ]); | ||||
0 | |||||||
15 | } | ||||||
16 | |||||||
17 | |||||||
18 | 1; |