| 1 | package Feed::Data::Parser::RSS; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use Moo; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 6 | extends 'Feed::Data::Parser::Base'; | |||||||||||||||||||||||||||||||
| 5 | 6 | ▶ | use XML::RSS::LibXML; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | 6 | ▶ | use Ref::Util ':all'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | 6 | ▶ | use Compiled::Params::OO qw/cpo/; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 8 | 6 | ▶ | use Types::Standard qw/Object HashRef Str/; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||
| 10 | 6 | our $validate; | |||||||||||||||||||||||||||||||
| 11 | BEGIN { | ||||||||||||||||||||||||||||||||
| 12 | 6 | ▶ | $validate = cpo( | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 13 | get_value => [Object, HashRef, Str], | ||||||||||||||||||||||||||||||||
| 14 | ); | ||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | has '+parser' => ( | ||||||||||||||||||||||||||||||||
| 18 | default => sub { | ||||||||||||||||||||||||||||||||
| 19 | 6 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 20 | 6 | return XML::RSS::LibXML->new->parse($self->content_ref); | |||||||||||||||||||||||||||||||
| 21 | }, | ||||||||||||||||||||||||||||||||
| 22 | 6 | ); | |||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||
| 24 | sub get_value { | ||||||||||||||||||||||||||||||||
| 25 | 132 | ▶ | my ($self, $item, $action) = $validate->get_value->(@_); | ||||||||||||||||||||||||||||||
|
Subroutine
get_value: called CC=4 SCAR=18.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||
| 27 | 132 | my $value = $item->{$action}; | |||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||
| 29 | 132 | ▶ | if ( is_scalarref(\$value) || is_arrayref($value) ){ | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
is_scalarref(\$value) or is_arrayref($value)
MC/DC0%0/2
is_scalarref(\$value) or is_arrayref($value)
is_scalarref(\$value)
is_arrayref($value)
Truth table33%1/3
A or B
A= is_scalarref(\$value)B= is_arrayref($value)
| |||||||||||||||||||||||||||||||||
| 30 | 132 | return $value; | |||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||
| 32 | elsif ( is_hashref($value) ){ | ||||||||||||||||||||||||||||||||
| 33 | 0 | return $value->{encoded}; | |||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||
| 36 | 0 | return ''; | |||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||
| 39 | 6 | 1; # End of Feed::Data | |||||||||||||||||||||||||||||||