File Coverage

blib/lib/POE/Component/WWW/HTMLTagAttributeCounter.pm
Criterion Covered Total %
statement 15 25 60.0
branch 0 4 0.0
condition 0 2 0.0
subroutine 5 9 55.5
pod 1 1 100.0
total 21 41 51.2


line stmt bran cond sub pod time code
1             package POE::Component::WWW::HTMLTagAttributeCounter;
2              
3 1     1   515725 use warnings;
  1         2  
  1         35  
4 1     1   4 use strict;
  1         2  
  1         49  
5              
6             our $VERSION = '1.001004'; # VERSION
7              
8 1     1   6 use POE;
  1         2  
  1         17  
9 1     1   404 use base 'POE::Component::NonBlockingWrapper::Base';
  1         2  
  1         90  
10 1     1   13 use WWW::HTMLTagAttributeCounter;
  1         2  
  1         278  
11              
12             sub _methods_define {
13 0     0     return ( count => '_wheel_entry' );
14             }
15              
16             sub count {
17 0     0 1   $poe_kernel->post( shift->{session_id} => count => @_ );
18             }
19              
20             sub _prepare_wheel {
21 0     0     my $self = shift;
22 0 0         $self->{obj} = WWW::HTMLTagAttributeCounter->new(
23             $self->{ua} ? $self->{ua} : ()
24             );
25             }
26              
27             sub _process_request {
28 0     0     my ( $self, $in_ref ) = @_;
29              
30 0   0       $in_ref->{type} ||= 'tag';
31 0           my $c = $self->{obj};
32 0 0         if ( my $result = $c->count( @$in_ref{qw/where what type/} ) ) {
33 0           @$in_ref{ qw/result result_readable/ } = ( $result, "$c" );
34             }
35             else {
36 0           $in_ref->{error} = $c->error;
37             }
38              
39             }
40              
41             1;
42             __END__