File Coverage

blib/lib/Mojo/DB/Connector/Role/ResultsRoles.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Mojo::DB::Connector::Role::ResultsRoles;
2 1     1   921 use Mojo::Base -role;
  1         4  
  1         19  
3              
4             requires 'new_connection';
5              
6             has results_roles => sub { [] };
7              
8             around new_connection => sub {
9             my $orig = shift;
10             my $self = shift;
11              
12             return $self->$orig(@_)
13             unless my @roles = @{ $self->results_roles };
14              
15             my $connection = $self->$orig(@_);
16             $connection->with_roles('Mojo::DB::Role::ResultsRoles');
17             push @{$connection->results_roles}, @roles;
18              
19             return $connection;
20             };
21              
22             1;
23             __END__