File Coverage

blib/lib/LINE/Bot/API/Client.pm
Criterion Covered Total %
statement 22 23 95.6
branch 1 4 25.0
condition 1 3 33.3
subroutine 6 6 100.0
pod 0 1 0.0
total 30 37 81.0


line stmt bran cond sub pod time code
1             package LINE::Bot::API::Client;
2 53     53   354 use strict;
  53         152  
  53         2217  
3 52     52   315 use warnings;
  52         233  
  52         2882  
4              
5 52     52   338 use Carp 'croak';
  52         147  
  52         3572  
6 52     52   385 use File::Basename 'basename';
  52         123  
  52         12797  
7              
8             sub new {
9 52     52 0 246 my(undef, %args) = @_;
10 52         183 my $backend = 'Furl';
11 52 0 33     313 if ($args{http_client} && $args{http_client}{backend}) {
12 0         0 $backend = $args{http_client}{backend};
13             }
14 52         263 my $klass = join '::', __PACKAGE__, $backend;
15 52     51   4330 eval "use $klass;"; ## no critic
  51         37470  
  51         256  
  51         1491  
16 52 50       311 croak $@ if $@;
17 52         379 $klass->new(%args);
18             }
19              
20             1;