File Coverage

blib/lib/DBIx/TransactionManager/Extended/Txn.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 2 100.0
condition n/a
subroutine 11 11 100.0
pod 5 8 62.5
total 38 41 92.6


line stmt bran cond sub pod time code
1             package DBIx::TransactionManager::Extended::Txn;
2 7     7   35 use strict;
  7         11  
  7         150  
3 7     7   25 use warnings;
  7         12  
  7         125  
4              
5 7     7   26 use DBIx::TransactionManager; ## XXX: it includes '::ScopeGuard' package
  7         10  
  7         1389  
6              
7             sub new {
8 10     10 0 4793 my ($class, $manager, %args) = @_;
9 10 100       60 $args{caller} = [caller(1)] unless $args{caller};
10 10         38 my $guard = DBIx::TransactionManager::ScopeGuard->new($manager => %args);
11 10         390 return bless [$guard, $manager] => $class;
12             }
13              
14 2     2 0 862 sub rollback { shift->[0]->rollback }
15 6     6 0 668 sub commit { shift->[0]->commit }
16              
17 1     1 1 6 sub context_data { shift->[1]->context_data }
18 1     1 1 8 sub add_hook_after_commit { shift->[1]->add_hook_after_commit(@_) }
19 1     1 1 9 sub add_hook_before_commit { shift->[1]->add_hook_before_commit(@_) }
20 1     1 1 9 sub remove_hook_after_commit { shift->[1]->remove_hook_after_commit(@_) }
21 1     1 1 8 sub remove_hook_before_commit { shift->[1]->remove_hook_before_commit(@_) }
22              
23             1;
24             __END__