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 47     47   1704 use strict;
  47         120  
  47         1373  
3 47     47   235 use warnings;
  47         100  
  47         1186  
4              
5 47     47   19315 use LINE::Bot::API::Response::Error;
  47         140  
  47         6860  
6              
7             sub new {
8 89     89 0 529 my($class, %args) = @_;
9 89         377 my $self = bless { %args }, $class;
10 89 100       428 bless $self, 'LINE::Bot::API::Response::Error' unless $self->is_success;
11 89         444 $self;
12             }
13              
14 177     177 0 7046 sub is_success { $_[0]->{http_status} == 200 }
15 88     88 0 463 sub http_status { $_[0]->{http_status} }
16 1     1 0 6 sub x_line_request_id { $_[0]->{http_headers}->header('X-Line-Request-Id') }
17              
18             1;