File Coverage

blib/lib/POE/Component/WWW/DoctypeGrabber.pm
Criterion Covered Total %
statement 15 28 53.5
branch 0 6 0.0
condition n/a
subroutine 5 9 55.5
pod 1 1 100.0
total 21 44 47.7


line stmt bran cond sub pod time code
1             package POE::Component::WWW::DoctypeGrabber;
2              
3 1     1   297514 use warnings;
  1         4  
  1         48  
4 1     1   7 use strict;
  1         1  
  1         57  
5              
6             our $VERSION = '1.001004'; # VERSION
7              
8 1     1   5 use POE;
  1         2  
  1         9  
9 1     1   328 use base 'POE::Component::NonBlockingWrapper::Base';
  1         2  
  1         106  
10 1     1   10 use WWW::DoctypeGrabber;
  1         2  
  1         256  
11              
12             sub _methods_define {
13 0     0     return ( grab => '_wheel_entry' );
14             }
15              
16             sub grab {
17 0     0 1   $poe_kernel->post( shift->{session_id} => grab => @_ );
18             }
19              
20             sub _prepare_wheel {
21 0     0     my $self = shift;
22 0 0         $self->{obj} = WWW::DoctypeGrabber->new(
23 0           %{ $self->{obj_args} || {} },
24             );
25             }
26              
27             sub _process_request {
28 0     0     my ( $self, $in_ref ) = @_;
29              
30 0           my $grabber = $self->{obj};
31 0 0         if ( exists $in_ref->{raw} ) {
32 0           $grabber->raw( $in_ref->{raw} );
33             }
34 0           my $grab = $grabber->grab( $in_ref->{page} );
35 0 0         if ( $grab ) {
36 0           $in_ref->{result} = $grab;
37             }
38             else {
39 0           $in_ref->{error} = $grabber->error;
40             }
41             }
42              
43             1;
44             __END__