File Coverage

blib/lib/Package/Watchdog/Tracker/Forbid.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 26 26 100.0


line stmt bran cond sub pod time code
1             package Package::Watchdog::Tracker::Forbid;
2 4     4   913 use strict;
  4         8  
  4         162  
3 4     4   51 use warnings;
  4         9  
  4         692  
4 4     4   558 use Package::Watchdog::Util;
  4         7  
  4         403  
5 4     4   3135 use Package::Watchdog::Sub::Forbidden;
  4         12  
  4         117  
6 4     4   20 use base 'Package::Watchdog::Tracker';
  4         6  
  4         4788  
7              
8             #{{{ POD
9              
10             =pod
11              
12             =head1 NAME
13              
14             Package::Watchdog::Tracker::Forbid - Track forbidden subs.
15              
16             =head1 DESCRIPTION
17              
18             See Package::Watchdog::Tracker() for more information.
19              
20             Used to track Package::Watchdog::Sub::Forbidden objects.
21              
22             =head1 ACCESSORS
23              
24             The following accessors methods are automatically generated using
25             Package::Watchdog::Util::build_accessors().
26              
27             =over 4
28              
29             =item params()
30              
31             Arrayref of parameters passed to the watched sub that was called causing this
32             object to come into existance.
33              
34             =item watched()
35              
36             The Package::Watchdog::Sub::Watched that is responsible for this objects
37             existance.
38              
39             =back
40              
41             =head1 METHODS
42              
43             =over 4
44              
45             =cut
46              
47             #}}}
48              
49             my @ACCESSORS = qw/package subs stack/;
50             build_accessors( @ACCESSORS );
51              
52             =item track_sub( $package, $sub )
53              
54             Forbid the specified sub in the specified package.
55              
56             =cut
57              
58             sub track_sub {
59 8     8 1 10 my $self = shift;
60 8         9 my ( $sub ) = @_;
61 8         24 my $forbidden = Package::Watchdog::Sub::Forbidden->new( $self->package, $sub, $self );
62 8         24 return $self;
63             }
64              
65             1;
66              
67             __END__