File Coverage

blib/lib/Catmandu/Fix/Condition/is_live_orcid.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::Condition::is_live_orcid;
2              
3             our $VERSION = '0.13';
4              
5 1     1   94215 use Catmandu::Sane;
  1         158602  
  1         6  
6 1     1   250 use Moo;
  1         2  
  1         4  
7 1     1   670 use WWW::ORCID;
  1         3444  
  1         24  
8 1     1   355 use Catmandu::Fix::Has;
  1         725  
  1         5  
9              
10             has path => (fix_arg => 1);
11              
12             with 'Catmandu::Fix::Condition::SimpleAllTest';
13              
14             sub emit_test {
15 0     0 0   my ($self, $var) = @_;
16 0           "(is_value(${var}) && WWW::ORCID::API::Pub->new->get_bio(${var})->{'orcid-profile'})";
17             }
18              
19             =head1 NAME
20              
21             Catmandu::Fix::Condition::is_live_orcid - test if the ORCID can be resolved
22              
23             =head1 SYNOPSIS
24              
25             if is_live_orcid(orcid)
26             ...
27             else
28             ...
29             end
30              
31             =head1 SEE ALSO
32              
33             L<Catmandu::Fix>
34              
35             =cut
36              
37             1;