Event/Role/ClassMethods.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 29 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 # ABSTRACT: Make MooseX::Event methods available as class methods on a singleton
2 package MooseX::Event::Role::ClassMethods;
3 {
4 $MooseX::Event::Role::ClassMethods::VERSION = 'v0.2.0';
5 }
6 use strict;
7 use warnings;
8 use Any::Moose 'Role';
9  
10 requires 'instance';
11  
12 around [qw( event_exists on once emit remove_all_listeners remove_listener )] => sub {
13 my $orig = shift;
14 if ( ! ref $_[0] ) {
15 my $class = shift;
16 unshift @_, $class->instance;
17 }
18 goto $orig;
19 };
20  
21 no Any::Moose 'Role';
22  
23 1;
24  
25  
26 __END__