| 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__ | ||