File Coverage

blib/lib/Catmandu/Fix/orcid_bio.pm
Criterion Covered Total %
statement 12 14 85.7
branch n/a
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 16 20 80.0


line stmt bran cond sub pod time code
1             package Catmandu::Fix::orcid_bio;
2              
3             our $VERSION = '0.14';
4              
5 1     1   92525 use Catmandu::Sane;
  1         167308  
  1         8  
6 1     1   304 use Moo;
  1         3  
  1         5  
7 1     1   786 use WWW::ORCID;
  1         3587  
  1         27  
8 1     1   357 use Catmandu::Fix::Has;
  1         866  
  1         6  
9              
10             has path => (fix_arg => 1);
11              
12             with 'Catmandu::Fix::SimpleGetValue';
13              
14             sub emit_value {
15 0     0 0   my ($self, $var) = @_;
16              
17 0           "${var} = WWW::ORCID::API::Pub->new->get_bio(${var}) if is_string(${var}) && length(${var});";
18             }
19              
20             =head1 NAME
21              
22             Catmandu::Fix::orcid_bio - find an ORCID bio for an identifier
23              
24             =head1 SYNOPSIS
25              
26             # Find an ORCID bio for an identifier
27             # orcid: '0000-0001-8390-6171'
28             orcid_bio(orcid)
29              
30             =head1 SEE ALSO
31              
32             L<Catmandu::Fix>,
33             L<WWW::ORCID>
34              
35             =cut
36              
37             1;