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 47     47   318 use strict;
  47         89  
  47         1374  
3 46     46   227 use warnings;
  46         90  
  46         1170  
4              
5 46     46   228 use Carp 'croak';
  46         80  
  46         2219  
6 46     46   286 use File::Basename 'basename';
  46         109  
  46         9853  
7              
8             sub new {
9 46     46 0 206 my(undef, %args) = @_;
10 46         143 my $backend = 'Furl';
11 46 0 33     211 if ($args{http_client} && $args{http_client}{backend}) {
12 0         0 $backend = $args{http_client}{backend};
13             }
14 46         221 my $klass = join '::', __PACKAGE__, $backend;
15 46     45   2616 eval "use $klass;"; ## no critic
  45         21830  
  45         189  
  45         1056  
16 46 50       273 croak $@ if $@;
17 46         317 $klass->new(%args);
18             }
19              
20             1;