File Coverage

blib/lib/Aspect/Pointcut/True.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 2 2 100.0
total 25 25 100.0


line stmt bran cond sub pod time code
1             package Aspect::Pointcut::True;
2              
3 21     21   84 use strict;
  21         24  
  21         583  
4 21     21   85 use warnings;
  21         25  
  21         500  
5 21     21   86 use Aspect::Pointcut ();
  21         22  
  21         2463  
6              
7             our $VERSION = '0.97_06';
8             our @ISA = 'Aspect::Pointcut';
9              
10              
11              
12              
13              
14             ######################################################################
15             # Weaving Methods
16              
17             # The true pointcut is a run-time only pointcut
18             sub curry_weave {
19 1     1 1 2 return;
20             }
21              
22             # The true pointcut contains no state and doesn't need to be curried.
23             # Simply return it as-is and reuse it everywhere.
24             sub curry_runtime {
25 1     1 1 3 return $_[0];
26             }
27              
28              
29              
30              
31              
32             ######################################################################
33             # Runtime Methods
34              
35             sub compile_runtime {
36             $_[0]->[0];
37             }
38              
39              
40              
41              
42              
43             ######################################################################
44             # Optional XS Acceleration
45              
46             BEGIN {
47 21     21   35 local $@;
48 21     21   1359 eval <<'END_PERL';
  21         102  
  21         333  
  21         183  
49             use Class::XSAccessor::Array 1.08 {
50             replace => 1,
51             getters => {
52             'compile_runtime' => 0,
53             },
54             };
55             END_PERL
56             }
57              
58             1;
59              
60             __END__