File Coverage

blib/lib/Starch/Plugin/Trace/State.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Starch::Plugin::Trace::State;
2             our $VERSION = '0.14';
3              
4 1     1   379 use Moo::Role;
  1         2  
  1         5  
5 1     1   256 use strictures 2;
  1         5  
  1         29  
6 1     1   142 use namespace::clean;
  1         2  
  1         4  
7              
8             with 'Starch::Plugin::ForState';
9              
10             after BUILD => sub{
11             my ($self) = @_;
12              
13             $self->log->tracef(
14             'starch.state.new.%s',
15             $self->id(),
16             );
17              
18             return;
19             };
20              
21             foreach my $method (qw(
22             save delete
23             reload rollback clear
24             mark_clean mark_dirty
25             set_expires reset_expires
26             reset_id
27             )) {
28             around $method => sub{
29             my $orig = shift;
30             my $self = shift;
31              
32             $self->log->tracef(
33             'starch.state.%s.%s',
34             $method, $self->id(),
35             );
36              
37             return $self->$orig( @_ );
38             };
39             }
40              
41             1;