File Coverage

blib/lib/LINE/Bot/API/Response/Common.pm
Criterion Covered Total %
statement 16 16 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod 0 4 0.0
total 25 29 86.2


line stmt bran cond sub pod time code
1             package LINE::Bot::API::Response::Common;
2 51     51   1859 use strict;
  51         113  
  51         1479  
3 51     51   254 use warnings;
  51         111  
  51         1341  
4              
5 51     51   22870 use LINE::Bot::API::Response::Error;
  51         157  
  51         7347  
6              
7             sub new {
8 93     93 0 559 my($class, %args) = @_;
9 93         418 my $self = bless { %args }, $class;
10 93 100       495 bless $self, 'LINE::Bot::API::Response::Error' unless $self->is_success;
11 93         519 $self;
12             }
13              
14 185     185 0 10262 sub is_success { $_[0]->{http_status} == 200 }
15 92     92 0 2013 sub http_status { $_[0]->{http_status} }
16 1     1 0 8 sub x_line_request_id { $_[0]->{http_headers}->header('X-Line-Request-Id') }
17              
18             1;