File Coverage

blib/lib/POEx/IRC/Backend/Role/HasWheel.pm
Criterion Covered Total %
statement 6 7 85.7
branch n/a
condition n/a
subroutine 2 3 66.6
pod n/a
total 8 10 80.0


line stmt bran cond sub pod time code
1             package POEx::IRC::Backend::Role::HasWheel;
2             $POEx::IRC::Backend::Role::HasWheel::VERSION = '0.030001';
3 5     5   2904 use Types::Standard -all;
  5         55064  
  5         60  
4              
5 5     5   169328 use Moo::Role;
  5         13  
  5         53  
6              
7             has wheel_id => (
8             lazy => 1,
9             isa => Defined,
10             is => 'ro',
11             writer => '_set_wheel_id',
12 0     0     builder => sub { shift->wheel->ID },
13             );
14              
15             has wheel => (
16             required => 1,
17             isa => Maybe[ InstanceOf['POE::Wheel'] ],
18             is => 'ro',
19             clearer => 'clear_wheel',
20             writer => 'set_wheel',
21             predicate => 'has_wheel',
22             trigger => sub {
23             my ($self, $wheel) = @_;
24             $self->_set_wheel_id( $wheel->ID )
25             },
26             );
27              
28             1;
29              
30             =pod
31              
32             =for Pod::Coverage has_\w+
33              
34             =head1 NAME
35              
36             POEx::IRC::Backend::Role::HasWheel
37              
38             =head1 SYNOPSIS
39              
40             A L for classes that have associated POE::Wheel instances.
41              
42             =head1 DESCRIPTION
43              
44             =head2 wheel
45              
46             A L instance (typically L for listeners
47             and connectors or L for live connections).
48              
49             This is primarily for internal use. External code should not interact directly
50             with the C.
51              
52             Can be cleared via B; use B to determine if this
53             listener's wheel has been cleared.
54              
55             Can be replaced via B (although whether this is a good idea or not
56             is debatable; better to spawn a new instance of your class)
57              
58             =head2 wheel_id
59              
60             The POE ID of the last known L.
61              
62             =head1 AUTHOR
63              
64             Jon Portnoy
65              
66             =cut