Catmandu/Fix/orcid_find.pm

filter: Statementstmt 88.8% 16 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 83.3% 20 / 24 CC 1 SCAR 1.8
CC
1
Cov
89%
emit_value
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Catmandu/Fix/orcid_bio.pm ↑ Summary Catmandu/Fix/orcid_profile.pm »
1 package Catmandu::Fix::orcid_find;
2  
3 1 our $VERSION = '0.15';
4  
5 1 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use WWW::ORCID;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 has path => (fix_arg => 1);
11  
12 1 with 'Catmandu::Fix::SimpleGetValue';
13  
14 0 ▶sub emit_value {
Subroutine emit_value: not called CC=1 SCAR=6.9
Pod undocumented
15 0 my ($self, $var) = @_;
16  
17 0 "${var} = WWW::ORCID::API::Pub->new->search_bio(${var}) if is_hash_ref(${var});";
18 }
19  
20 =head1 NAME
21  
22 Catmandu::Fix::orcid_find - find an ORCID id for a query
23  
24 =head1 SYNOPSIS
25  
26 # Find ORCID bio for a query
27 # query:
28 # q: "Johson"
29 orcid_find(query)
30  
31 if exists(orcid.orcid-search-results.num-found)
32 copy_field(orcid.orcid-search-results.orcid-search-result.0.orcid-profile.orcid-identifier.path,id)
33 end
34  
35 =head1 SEE ALSO
36  
37 L<Catmandu::Fix>,
38 L<WWW::ORCID>
39  
40 =cut
41  
42 1 1;
« Catmandu/Fix/orcid_bio.pm ↑ Summary Catmandu/Fix/orcid_profile.pm »