EventReceiver/Callback.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 23 / 23 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
handle_access
1.0
CRAP 1.0
« EventReceiver.pm ↑ Summary
1 package AnyEvent::Inotify::EventReceiver::Callback;
2 1 $AnyEvent::Inotify::EventReceiver::Callback::VERSION = '0.04';
3 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 #use namespace::autoclean;
5  
6 3 ▶use MooseX::Types::Moose qw(CodeRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 has 'callback' => (
9 traits => ['Code'],
10 is => 'ro',
11 isa => CodeRef,
12 required => 1,
13 handles => {
14 call_callback => 'execute',
15 },
16 );
17  
18 1 for my $event (qw/access modify attribute_change close open move delete create/){
19 3 ▶ __PACKAGE__->meta->add_method( "handle_$event" => sub {
Subroutine handle_create: called CC=1 SCAR=0.0
Subroutine handle_move: called CC=1 SCAR=0.0
Subroutine handle_access: called CC=1 SCAR=0.0
20 3 my $self = shift;
21 3 $self->call_callback($event, @_);
22 8 });
23 }
24  
25 1 with 'AnyEvent::Inotify::EventReceiver';
26  
27 1 1;
28  
29 __END__
« EventReceiver.pm ↑ Summary