POE/Role.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 50.0% 1 / 2 totaltotal 96.4% 27 / 28 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
init_meta
1.0
CRAP 1.0
« POE.pm ↑ Summary POE/Meta/Method/State.pm »
1 package MooseX::POE::Role;
2 {
3 5 $MooseX::POE::Role::VERSION = '0.215';
4 }
5 # ABSTRACT: Eventful roles
6 5 ▶use MooseX::POE::Meta::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 ▶use Moose::Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 5 my ( $import, $unimport, $init_meta ) = Moose::Exporter->setup_import_methods(
11 with_caller => [qw(event)],
12 also => 'Moose::Role',
13 install => [qw(import unimport)],
14 role_metaroles => {
15 role => ['MooseX::POE::Meta::Role'],
16 },
17 );
18  
19 5 ▶sub init_meta {
Subroutine init_meta: called CC=1 SCAR=0.0
Pod undocumented
20 5 my ( $class, %args ) = @_;
21  
22 5 my $for = $args{for_class};
23 5 ▶ eval qq{package $for; use POE; };
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 5 Moose::Role->init_meta( for_class => $for );
26  
27 5 goto $init_meta;
28 }
29  
30 5 ▶sub event {
Subroutine event: called CC=1 SCAR=0.0
Pod documented
31 5 my ( $caller, $name, $method ) = @_;
32 5 my $class = Moose::Meta::Class->initialize($caller);
33 5 $class->add_state_method( $name => $method );
34 }
35  
36  
37 5 1;
38  
39  
40 =pod
41  
42 =head1 NAME
43  
44 MooseX::POE::Role - Eventful roles
45  
46 =head1 VERSION
47  
48 version 0.215
49  
50 =head1 SYNOPSIS
51  
52 package Counter;
53 use MooseX::POE::Role;
54  
55 ...
56  
57 package RealCounter;
58  
59 with qw(Counter);
60  
61 =head1 DESCRIPTION
62  
63 This is what L<MooseX::POE> is to Moose but with L<Moose::Role>.
64  
65 =head1 METHODS
66  
67 =head2 event $name $subref
68  
69 Create an event handler named $name.
70  
71 =head1 KEYWORDS
72  
73 =for :list * L<MooseX::POE|MooseX::POE>
74 * L<Moose::Role>
75  
76 =head1 AUTHORS
77  
78 =over 4
79  
80 =item *
81  
82 Chris Prather <chris@prather.org>
83  
84 =item *
85  
86 Ash Berlin <ash@cpan.org>
87  
88 =item *
89  
90 Chris Williams <chris@bingosnet.co.uk>
91  
92 =item *
93  
94 Yuval (nothingmuch) Kogman
95  
96 =item *
97  
98 Torsten Raudssus <torsten@raudssus.de> L<http://www.raudssus.de/>
99  
100 =back
101  
102 =head1 COPYRIGHT AND LICENSE
103  
104 This software is copyright (c) 2010 by Chris Prather, Ash Berlin, Chris Williams, Yuval Kogman, Torsten Raudssus.
105  
106 This is free software; you can redistribute it and/or modify it under
107 the same terms as the Perl 5 programming language system itself.
108  
109 =cut
110  
111  
112 __END__
« POE.pm ↑ Summary POE/Meta/Method/State.pm »