| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Feed::Data::Parser::Table; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 670 | use Moo; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 7 |  | 
| 4 |  |  |  |  |  |  | extends 'Feed::Data::Parser::Base'; | 
| 5 | 1 |  |  | 1 |  | 444 | use Compiled::Params::OO qw/cpo/; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 18 |  | 
| 6 | 1 |  |  | 1 |  | 109 | use Types::Standard qw/Object HashRef Str/; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 41 |  | 
| 7 | 1 |  |  | 1 |  | 990 | use HTML::TableContent; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 11 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | our $validate; | 
| 10 |  |  |  |  |  |  | BEGIN { | 
| 11 | 1 |  |  | 1 |  | 67 | $validate = cpo( | 
| 12 |  |  |  |  |  |  | get_value => [Object, HashRef, Str], | 
| 13 |  |  |  |  |  |  | ); | 
| 14 |  |  |  |  |  |  | } | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | has '+parser' => ( | 
| 17 |  |  |  |  |  |  | default => sub { | 
| 18 |  |  |  |  |  |  | my $self = shift; | 
| 19 |  |  |  |  |  |  | my $content = $self->content_ref; | 
| 20 |  |  |  |  |  |  | my $t = HTML::TableContent->new(); | 
| 21 |  |  |  |  |  |  | $t->parse($$content); | 
| 22 |  |  |  |  |  |  | return { items => $t->get_first_table->aoh }; | 
| 23 |  |  |  |  |  |  | }, | 
| 24 |  |  |  |  |  |  | ); | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | sub get_value { | 
| 27 | 22 |  |  | 22 | 0 | 52 | my ($self, $item, $action) = $validate->get_value->(@_); | 
| 28 | 22 |  |  |  |  | 218 | my $value = $item->{$action}; | 
| 29 | 22 |  | 100 |  |  | 91 | return $value // ''; | 
| 30 |  |  |  |  |  |  | } | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | 1; # End of Feed::Data |