File Coverage

blib/lib/Plient/Handler.pm
Criterion Covered Total %
statement 7 20 35.0
branch n/a
condition n/a
subroutine 3 9 33.3
pod 0 6 0.0
total 10 35 28.5


line stmt bran cond sub pod time code
1             package Plient::Handler;
2 5     5   2406 use strict;
  5         10  
  5         184  
3 5     5   25 use warnings;
  5         19  
  5         1156  
4              
5 0     0 0 0 sub protocol { warn "you should subclass protocol"; return }
  0         0  
6 0     0 0 0 sub method { warn "you should subclass method"; return }
  0         0  
7 0     0 0 0 sub init { };
8              
9             # XXX TODO add protocol version support?
10             sub may_support_protocol {
11 0     0 0 0 my $class = shift;
12 0         0 my $protocol = shift;
13 0         0 exists $class->all_protocol->{$protocol};
14             }
15              
16             # call this after init(), or maybe nothing will return
17             sub support_protocol {
18 0     0 0 0 my $class = shift;
19 0         0 my $protocol = shift;
20 0         0 exists $class->protocol->{$protocol};
21             }
22              
23             # subclass this method to check $args if
24             # the handler is not *full fledged*
25             sub support_method {
26 0     0 0 0 my ( $class, $method, $args ) = @_;
27 0         0 $class->method->{ $method };
28             }
29              
30             sub _add_to_plient {
31 1     1   352 Plient->_add_handlers(shift);
32             }
33              
34              
35             1;
36              
37             __END__