File Coverage

blib/lib/POE/Declare/Meta/Message.pm
Criterion Covered Total %
statement 17 18 94.4
branch n/a
condition n/a
subroutine 6 7 85.7
pod 0 1 0.0
total 23 26 88.4


line stmt bran cond sub pod time code
1             package POE::Declare::Meta::Message;
2              
3             =pod
4              
5             =head1 NAME
6              
7             POE::Declare::Meta::Message - A named message that is emitted to the parent
8              
9             =head1 SYNOPSIS
10              
11             # Declare the message (in the child)
12             declare ShutdownComplete => 'Message';
13            
14             # Emit the message (in the child)
15             $self->send_message('ShutdownComplete', 'param');
16            
17             # Register for the message (in the parent)
18             my $child = Foo::Child->new(
19             ShutdownComplete => $self->lookback('child_completed'),
20             );
21              
22             =head1 DESCRIPTION
23              
24             Each L object contains a series of declared messages.
25              
26             Message registration is done (primarily) during object creation, and
27             the parameter checking for each message parameter is checked in a defined
28             way.
29              
30             =cut
31              
32 4     4   70 use 5.008007;
  4         11  
  4         144  
33 4     4   21 use strict;
  4         8  
  4         106  
34 4     4   19 use warnings;
  4         19  
  4         83  
35 4     4   2125 use POE::Declare::Meta::Param ();
  4         10  
  4         82  
36              
37 4     4   54 use vars qw{$VERSION @ISA};
  4         7  
  4         213  
38             BEGIN {
39 4     4   8 $VERSION = '0.59';
40 4         408 @ISA = 'POE::Declare::Meta::Param';
41             }
42              
43 0     0 0   sub as_perl { <<"END_PERL" }
44             sub $_[0]->{name} {
45             \$_[0]->{$_[0]->{name}} or return '';
46             \$_[0]->{$_[0]->{name}}->( \$_[0]->{Alias}, \@_[1..\$#_] );
47             return 1;
48             }
49             END_PERL
50              
51             1;
52              
53             =pod
54              
55             =head1 SUPPORT
56              
57             Bugs should be always be reported via the CPAN bug tracker at
58              
59             L
60              
61             For other issues, or commercial enhancement or support, contact the author.
62              
63             =head1 AUTHORS
64              
65             Adam Kennedy Eadamk@cpan.orgE
66              
67             =head1 SEE ALSO
68              
69             L, L
70              
71             =head1 COPYRIGHT
72              
73             Copyright 2006 - 2012 Adam Kennedy.
74              
75             This program is free software; you can redistribute
76             it and/or modify it under the same terms as Perl itself.
77              
78             The full text of the license can be found in the
79             LICENSE file included with this module.
80              
81             =cut