Tickit/Driver.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 41 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
write
2.0
BEGIN
2.0
CRAP 2.0
1 # You may distribute under the terms of either the GNU General Public License
2 # or the Artistic License (the same terms as Perl itself)
3 #
4 # (C) Nick Shipp, 2016 -- nick@shipp.ninja
5  
6 package POEx::Tickit::Driver;
7  
8 use strict;
9 use warnings;
10 use base qw( POE::Driver::SysRW );
11  
12 our $VERSION = '0.04';
13  
14 use Carp;
15  
16 =head1 NAME
17  
18 C<POEx::Tickit::Driver> - Wrap L<POE::Driver::SysRW> with a C<write()> for Tickit
19  
20 =head1 DESCRIPTION
21  
22 This module is used internally to provide a C<write()> for L<Tickit::Term> based
23 on L<POEx::Driver::SysRW>.
24  
25 =cut
26  
27 use constant OUTPUT_HANDLE => 5;
28  
29 sub new
30 {
31 my $class = shift;
32 my %args = @_;
33  
34 defined( my $handle = delete $args{Handle} ) or
35 croak "$class requires Handle";
36  
37 my $self = $class->SUPER::new( %args );
38  
39 $self->[OUTPUT_HANDLE] = $handle;
40  
41 return $self;
42 }
43  
44 sub write
45 {
46 my $self = shift;
47 my ( $record ) = @_;
48  
49 $self->put( [ $record ] );
50 $self->flush( $self->[OUTPUT_HANDLE] );
51 }
52  
53 0x55AA;