File Coverage

blib/lib/WWW/GoKGS/Scraper/Declare.pm
Criterion Covered Total %
statement 15 22 68.1
branch 1 2 50.0
condition 1 2 50.0
subroutine 5 6 83.3
pod 0 1 0.0
total 22 33 66.6


line stmt bran cond sub pod time code
1             package WWW::GoKGS::Scraper::Declare;
2 9     9   49 use strict;
  9         19  
  9         391  
3 9     9   52 use warnings;
  9         76  
  9         252  
4 9     9   48 use parent qw/Web::Scraper/;
  9         26  
  9         176  
5 9     9   236547 use HTML::TreeBuilder::XPath;
  9         24  
  9         179  
6              
7             sub _tree_builder_class {
8 7     7   8 my $self = shift;
9 7 50       21 $self->{_tree_builder_class} = shift if @_;
10 7   50     35 $self->{_tree_builder_class} ||= 'HTML::TreeBuilder::XPath';
11             }
12              
13             sub build_tree {
14 0     0 0   my ( $self, $html ) = @_;
15 0           my $tree = $self->_tree_builder_class->new;
16 0           $tree->store_comments(1);
17 0           $tree->ignore_unknown(0);
18 0           $tree->parse($html);
19 0           $tree->eof;
20 0           $tree;
21             }
22              
23             1;