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   1937 use strict;
  4         11  
  4         116  
3 4     4   21 use warnings;
  4         7  
  4         91  
4 4     4   18 use utf8;
  4         9  
  4         17  
5              
6 4     4   2333 use Data::Validator;
  4         128212  
  4         180  
7             use Class::Accessor::Lite (
8 4         46     new => 1,
9                 rw => [qw/ client /],
10 4     4   40 );
  4         10  
11              
12             sub base_name {
13 106     106 0 179     my $self = shift;
14 106         516     my @components = split /::/, ref $self;
15 106         644     return lc $components[-1];
16             }
17              
18             sub request {
19 108     108 0 274     my ($self, $path, $args) = @_;
20 108         304     my $request_path = sprintf '/%s.%s', $self->base_name, $path;
21 108         441     return $self->client->request($request_path, $args);
22             }
23              
24             1;
25              
26