Remove requirement for dummy command method in hook-only plugins
This commit is contained in:
parent
cf8ce7dc52
commit
6850ed22be
15 changed files with 8 additions and 27 deletions
|
@ -38,6 +38,8 @@ sub import {
|
|||
|
||||
}
|
||||
|
||||
__PACKAGE__->import;
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue