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   1895 use strict;
  4         9  
  4         119  
3 4     4   19 use warnings;
  4         6  
  4         93  
4 4     4   18 use utf8;
  4         10  
  4         19  
5              
6 4     4   2214 use Data::Validator;
  4         132669  
  4         194  
7             use Class::Accessor::Lite (
8 4         50     new => 1,
9                 rw => [qw/ client /],
10 4     4   42 );
  4         8  
11              
12             sub base_name {
13 106     106 0 178     my $self = shift;
14 106         466     my @components = split /::/, ref $self;
15 106         578     return lc $components[-1];
16             }
17              
18             sub request {
19 108     108 0 284     my ($self, $path, $args) = @_;
20 108         279     my $request_path = sprintf '/%s.%s', $self->base_name, $path;
21 108         388     return $self->client->request($request_path, $args);
22             }
23              
24             1;
25              
26