Remove requirement for dummy command method in hook-only plugins

This commit is contained in:
Juerd Waalboer 2021-12-03 01:47:28 +01:00
parent cf8ce7dc52
commit 6850ed22be
15 changed files with 8 additions and 27 deletions

View file

@ -38,6 +38,8 @@ sub import {
}
__PACKAGE__->import;
1;
__END__

View file

@ -1,10 +1,14 @@
package RevBank::Plugin;
use strict;
require RevBank::Global;
sub new {
my ($class) = @_;
return bless { }, $class;
}
sub command {
return RevBank::Global::NEXT();
}
1;

View file

@ -52,9 +52,8 @@ There is no protection against infinite loops. Be careful!
$a = parse_amount($a) or return REJECT, "$a: Invalid amount.";
$cart->add($u, $a, 'Good, except that $a is special in Perl :)');
There are two kinds of plugin methods: input methods and hooks. A plugin MUST
define one C<command> input method (but it MAY be a no-op), and can have any
number of hooks.
There are two kinds of plugin methods: input methods and hooks. A plugin may
define one C<command> input method, and can have any number of hooks.
=head2 Input methods