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 51     51   383 use strict;
  51         112  
  51         1562  
3 50     50   252 use warnings;
  50         94  
  50         1341  
4              
5 50     50   259 use Carp 'croak';
  50         100  
  50         2746  
6 50     50   308 use File::Basename 'basename';
  50         109  
  50         11254  
7              
8             sub new {
9 50     50 0 238 my(undef, %args) = @_;
10 50         155 my $backend = 'Furl';
11 50 0 33     254 if ($args{http_client} && $args{http_client}{backend}) {
12 0         0 $backend = $args{http_client}{backend};
13             }
14 50         246 my $klass = join '::', __PACKAGE__, $backend;
15 50     49   2964 eval "use $klass;"; ## no critic
  49         27073  
  49         204  
  49         1266  
16 50 50       293 croak $@ if $@;
17 50         391 $klass->new(%args);
18             }
19              
20             1;