File Coverage

blib/lib/Event/generic.pm
Criterion Covered Total %
statement 15 16 93.7
branch n/a
condition 1 2 50.0
subroutine 5 6 83.3
pod 1 1 100.0
total 22 25 88.0


line stmt bran cond sub pod time code
1 1     1   1462 use strict;
  1         2  
  1         59  
2             package Event::generic;
3 1     1   4 use base 'Event::Watcher';
  1         1  
  1         84  
4 1     1   3 use vars qw(@ATTRIBUTE);
  1         2  
  1         167  
5             @ATTRIBUTE = qw(source);
6              
7             'Event::Watcher'->register;
8              
9             sub new {
10             # lock %Event::;
11              
12 2     2 1 1 my $class = shift;
13 2         6 my %arg = @_;
14 2   50     87 my $o = allocate($class, delete $arg{attach_to} || {});
15 2         11 $o->init(\%arg);
16 2         4 $o;
17             }
18              
19             package Event::generic::Source;
20              
21             sub new($) {
22 1     1   15 return allocate($_[0], {});
23             }
24              
25             sub watch(@) {
26 0     0     return Event->generic("source", @_);
27             }
28              
29             1;