File Coverage

blib/lib/WWW/ORCID/Transport.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package WWW::ORCID::Transport;
2              
3 3     3   95550 use strict;
  3         11  
  3         117  
4 3     3   25 use warnings;
  3         10  
  3         174  
5              
6             our $VERSION = 0.0401;
7              
8 3     3   393 use Moo::Role;
  3         18450  
  3         35  
9 3     3   2306 use namespace::clean;
  3         10887  
  3         31  
10              
11             with 'WWW::ORCID::Base';
12              
13             for my $method (qw(get post_form post put delete)) {
14             requires $method;
15              
16             around $method => sub {
17             my $orig = shift;
18             my $self = shift;
19             if ($self->log->is_debug) {
20             $self->log->debugf("$method request: %s", \@_);
21             }
22             my $res = $orig->($self, @_);
23             if ($self->log->is_debug) {
24             $self->log->debugf("$method response: %s", $res);
25             }
26             $res;
27             };
28             }
29              
30             1;