File Coverage

blib/lib/WebService/Slack/WebApi/Base.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 0 2 0.0
total 28 30 93.3


line stmt bran cond sub pod time code
1             package WebService::Slack::WebApi::Base;
2 4     4   1982 use strict;
  4         9  
  4         117  
3 4     4   20 use warnings;
  4         10  
  4         89  
4 4     4   19 use utf8;
  4         8  
  4         18  
5              
6 4     4   2124 use Data::Validator;
  4         134816  
  4         183  
7             use Class::Accessor::Lite (
8 4         42 new => 1,
9             rw => [qw/ client /],
10 4     4   41 );
  4         11  
11              
12             sub base_name {
13 106     106 0 188 my $self = shift;
14 106         505 my @components = split /::/, ref $self;
15 106         594 return lc $components[-1];
16             }
17              
18             sub request {
19 110     110 0 287 my ($self, $path, $args) = @_;
20 110         318 my $request_path = sprintf '/%s.%s', $self->base_name, $path;
21 110         417 return $self->client->request($request_path, $args);
22             }
23              
24             1;
25