Plient/Handler.pm

filter: Statementstmt 40.0% 8 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 3 / 9 Podpod 0.0% 0 / 6 totaltotal 31.4% 11 / 35 CC 1 SCAR 4.4
CC
1
Cov
40%
protocol
2.0
method
2.0
may_support_protocol
2.0
CRAP 1.6
« Plient/Protocol/File.pm ↑ Summary Plient/Protocol/HTTP.pm »
1 package Plient::Handler;
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 0 ▶sub protocol { warn "you should subclass protocol"; return }
Subroutine protocol: not called CC=1 SCAR=6.9
Pod undocumented
6 0 ▶sub method { warn "you should subclass method"; return }
Subroutine method: not called CC=1 SCAR=6.9
Pod undocumented
7 0 ▶sub init { };
Subroutine init: not called CC=1 SCAR=0.0
Pod undocumented
8  
9 # XXX TODO add protocol version support?
10 0 ▶sub may_support_protocol {
Subroutine may_support_protocol: not called CC=1 SCAR=6.9
Pod undocumented
11 0 my $class = shift;
12 0 my $protocol = shift;
13 0 exists $class->all_protocol->{$protocol};
14 }
15  
16 # call this after init(), or maybe nothing will return
17 0 ▶sub support_protocol {
Subroutine support_protocol: not called CC=1 SCAR=6.9
Pod undocumented
18 0 my $class = shift;
19 0 my $protocol = shift;
20 0 exists $class->protocol->{$protocol};
21 }
22  
23 # subclass this method to check $args if
24 # the handler is not *full fledged*
25 0 ▶sub support_method {
Subroutine support_method: not called CC=1 SCAR=6.9
Pod undocumented
26 0 my ( $class, $method, $args ) = @_;
27 0 $class->method->{ $method };
28 }
29  
30 1 ▶sub _add_to_plient {
Subroutine _add_to_plient: called CC=1 SCAR=0.0
31 1 Plient->_add_handlers(shift);
32 }
33  
34  
35 5 1;
36  
37 __END__
« Plient/Protocol/File.pm ↑ Summary Plient/Protocol/HTTP.pm »