File Coverage

blib/lib/POE/Declare/Meta/Message.pm
Criterion Covered Total %
statement 16 17 94.1
branch n/a
condition n/a
subroutine 6 7 85.7
pod n/a
total 22 24 91.6


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 7     7   89 use 5.008007;
  7         15  
33 7     7   24 use strict;
  7         60  
  7         114  
34 7     7   21 use warnings;
  7         7  
  7         127  
35 7     7   2089 use POE::Declare::Meta::Param ();
  7         10  
  7         112  
36              
37 7     7   26 use vars qw{$VERSION @ISA};
  7         5  
  7         296  
38             BEGIN {
39 7     7   13 $VERSION = '0.23_01';
40 7         422 @ISA = 'POE::Declare::Meta::Param';
41             }
42              
43 0     0     sub _compile { <<"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 - 2009 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