File Coverage

blib/lib/Aspect/Pointcut/Highest.pm
Criterion Covered Total %
statement 29 29 100.0
branch n/a
condition n/a
subroutine 12 12 100.0
pod 4 4 100.0
total 45 45 100.0


line stmt bran cond sub pod time code
1             package Aspect::Pointcut::Highest;
2              
3 21     21   83 use strict;
  21         24  
  21         589  
4 21     21   81 use warnings;
  21         28  
  21         521  
5 21     21   74 use Carp ();
  21         25  
  21         257  
6 21     21   72 use Scalar::Util ();
  21         26  
  21         245  
7 21     21   64 use Params::Util ();
  21         21  
  21         236  
8 21     21   7198 use Aspect::Guard ();
  21         39  
  21         337  
9 21     21   99 use Aspect::Pointcut ();
  21         30  
  21         3387  
10              
11             our $VERSION = '0.97_06';
12             our @ISA = 'Aspect::Pointcut';
13              
14              
15              
16              
17              
18             ######################################################################
19             # Constructor Methods
20              
21             sub new {
22 3     3 1 62 bless [ ], $_[0];
23             }
24              
25              
26              
27              
28              
29             ######################################################################
30             # Weaving Methods
31              
32             # The highest pointcut is a run-time only pointcut
33             sub curry_weave {
34 1     1 1 4 return;
35             }
36              
37             # Call pointcuts curry away to null, because they are the basis
38             # for which methods to hook in the first place. Any method called
39             # at run-time has already been checked.
40             sub curry_runtime {
41 3     3 1 14 bless [ 0 ], $_[0];
42             }
43              
44              
45              
46              
47              
48             ######################################################################
49             # Runtime Methods
50              
51             sub compile_runtime {
52 1     1 1 2 my $depth = 0;
53             return sub {
54 4     4   22 $_->{highest} = Aspect::Guard->new( sub { $depth-- } );
  4         12  
55 4         75 return ! $depth++;
56 1         7 };
57             }
58              
59             1;
60              
61             __END__