| 1 | package Reply::Plugin; | ||||||||||
| 2 | 19 | our $AUTHORITY = 'cpan:DOY'; | |||||||||
| 3 | 19 | $Reply::Plugin::VERSION = '0.42'; | |||||||||
| 4 | 19 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 19 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | # ABSTRACT: base class for Reply plugins | ||||||||||
| 7 | |||||||||||
| 8 | 19 | ▶ | use Reply::Util 'methods'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 12 | 0 | my $class = shift; | |||||||||
| 13 | 0 | my (%opts) = @_; | |||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | die "publisher is required" unless $opts{publisher}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | |||||||||||
| 17 | return bless { | ||||||||||
| 18 | publisher => $opts{publisher}, | ||||||||||
| 19 | 0 | }, $class; | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | sub publish { | ||||||||
|
Subroutine
publish: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 24 | 0 | my $self = shift; | |||||||||
| 25 | |||||||||||
| 26 | 0 | $self->{publisher}->(@_); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | sub commands { | ||||||||
|
Subroutine
commands: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 31 | 0 | my $self = shift; | |||||||||
| 32 | |||||||||||
| 33 | 0 | return map { s/^command_//; $_ } grep { /^command_/ } methods($self); | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | 19 | 1; | |||||||||
| 38 | |||||||||||
| 39 | __END__ | ||||||||||