| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package POE::Filter::LOLCAT; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 2 |  |  | 2 |  | 26014 | use strict; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 76 |  | 
| 4 | 2 |  |  | 2 |  | 10 | use warnings; | 
|  | 2 |  |  |  |  | 2 |  | 
|  | 2 |  |  |  |  | 54 |  | 
| 5 | 2 |  |  | 2 |  | 904 | use Acme::LOLCAT (); | 
|  | 0 |  |  |  |  |  |  | 
|  | 0 |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | use base qw(POE::Filter); | 
| 7 |  |  |  |  |  |  | use vars qw($VERSION); | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | $VERSION = '1.10'; | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | sub new { | 
| 12 |  |  |  |  |  |  | my $class = shift; | 
| 13 |  |  |  |  |  |  | my %opts = @_; | 
| 14 |  |  |  |  |  |  | $opts{lc $_} = delete $opts{$_} for keys %opts; | 
| 15 |  |  |  |  |  |  | $opts{BUFFER} = []; | 
| 16 |  |  |  |  |  |  | return bless \%opts, $class; | 
| 17 |  |  |  |  |  |  | } | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | sub get_one_start { | 
| 20 |  |  |  |  |  |  | my ($self, $raw) = @_; | 
| 21 |  |  |  |  |  |  | push @{ $self->{BUFFER} }, $_ for @$raw; | 
| 22 |  |  |  |  |  |  | } | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | sub get_one { | 
| 25 |  |  |  |  |  |  | my $self = shift; | 
| 26 |  |  |  |  |  |  | my $events = []; | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  | my $event = shift @{ $self->{BUFFER} }; | 
| 29 |  |  |  |  |  |  | if ( defined $event ) { | 
| 30 |  |  |  |  |  |  | my $record = Acme::LOLCAT::translate($event); | 
| 31 |  |  |  |  |  |  | push @$events, $record if $record; | 
| 32 |  |  |  |  |  |  | } | 
| 33 |  |  |  |  |  |  | return $events; | 
| 34 |  |  |  |  |  |  | } | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  | sub get_pending { | 
| 37 |  |  |  |  |  |  | my $self = shift; | 
| 38 |  |  |  |  |  |  | return $self->{BUFFER}; | 
| 39 |  |  |  |  |  |  | } | 
| 40 |  |  |  |  |  |  |  | 
| 41 |  |  |  |  |  |  | sub put { | 
| 42 |  |  |  |  |  |  | return; | 
| 43 |  |  |  |  |  |  | } | 
| 44 |  |  |  |  |  |  |  | 
| 45 |  |  |  |  |  |  | sub clone { | 
| 46 |  |  |  |  |  |  | my $self = shift; | 
| 47 |  |  |  |  |  |  | my $nself = { }; | 
| 48 |  |  |  |  |  |  | $nself->{$_} = $self->{$_} for keys %{ $self }; | 
| 49 |  |  |  |  |  |  | $nself->{BUFFER} = [ ]; | 
| 50 |  |  |  |  |  |  | return bless $nself, ref $self; | 
| 51 |  |  |  |  |  |  | } | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | 1; | 
| 54 |  |  |  |  |  |  | __END__ |