File Coverage

blib/lib/BeamX/Peer/Listener.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package BeamX::Peer::Listener;
2              
3 1     1   504 use Types::Standard ':all';
  1         2  
  1         8  
4 1     1   29275 use Moo;
  1         2  
  1         10  
5              
6             our $VERSION = '0.003';
7              
8             extends 'Beam::Listener';
9              
10             #pod =attr peer
11             #pod
12             #pod An optional reference to a peer object, allowing the emitter to
13             #pod send it an event directly using L. The
14             #pod object must consume the B role.
15             #pod
16             #pod =cut
17              
18             #pod =method has_peer
19             #pod
20             #pod $bool = $self->has_peer();
21             #pod
22             #pod This returns true if the object's peer attribute has been set
23             #pod
24             #pod =cut
25              
26             has peer => (
27             is => 'ro',
28             weak_ref => 1,
29             isa => ConsumerOf ['BeamX::Peer::Emitter'],
30             predicate => 1
31             );
32              
33             1;
34              
35             #
36             # This file is part of BeamX-Peer-Emitter
37             #
38             # This software is Copyright (c) 2016 by the Smithsonian Astrophysical Observatory.
39             #
40             # This is free software, licensed under:
41             #
42             # The GNU General Public License, Version 3, June 2007
43             #
44              
45             =pod
46              
47             =encoding UTF-8
48              
49             =head1 NAME
50              
51             BeamX::Peer::Listener
52              
53             =head1 VERSION
54              
55             version 0.003
56              
57             =head1 SYNOPSIS
58              
59             # optional peer
60             %args = ( peer => $peer );
61             $emitter->subscribe( $event_name, $subref, %args );
62              
63             =head1 DESCRIPTION
64              
65             This is the default Listener object created by the
66             L method when a callback subscription is
67             registered. It sub-classes L.
68              
69             =head1 ATTRIBUTES
70              
71             =head2 peer
72              
73             An optional reference to a peer object, allowing the emitter to
74             send it an event directly using L. The
75             object must consume the B role.
76              
77             =head1 METHODS
78              
79             =head2 has_peer
80              
81             $bool = $self->has_peer();
82              
83             This returns true if the object's peer attribute has been set
84              
85             =head1 AUTHOR
86              
87             Diab Jerius
88              
89             =head1 COPYRIGHT AND LICENSE
90              
91             This software is Copyright (c) 2016 by the Smithsonian Astrophysical Observatory.
92              
93             This is free software, licensed under:
94              
95             The GNU General Public License, Version 3, June 2007
96              
97             =cut
98              
99             __END__