line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::RKD::API::Extract; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
2592
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
174
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has results => (is => 'ro', required => 1); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has items => (is => 'lazy'); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub _build_items { |
12
|
0
|
|
|
0
|
|
|
my $self = shift; |
13
|
0
|
|
|
|
|
|
return $self->extract($self->results); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub __extract { |
17
|
0
|
|
|
0
|
|
|
my ($self, $item) = @_; |
18
|
|
|
|
|
|
|
return { |
19
|
|
|
|
|
|
|
'guid' => $item->{'guid'}->{'content'}, |
20
|
|
|
|
|
|
|
'artist_link' => $item->{'link'}, |
21
|
|
|
|
|
|
|
'title' => $item->{'title'}, |
22
|
0
|
|
|
|
|
|
'description' => $item->{'description'} |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub extract { |
27
|
0
|
|
|
0
|
0
|
|
my ($self, $items) = @_; |
28
|
0
|
|
|
|
|
|
my $extracted = []; |
29
|
0
|
|
|
|
|
|
foreach my $item (@{$items}) { |
|
0
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
push @{$extracted}, $self->__extract($item); |
|
0
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
return $extracted; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |