|| ($hook->{except} && $hook->{except}->{$action});
if (ref($hook->{code}) eq 'CODE') {
- $hook->{code}->($self);
+ $hook->{code}->($self, $action);
} else {
my $sub = $hook->{code};
- $self->$sub;
+ $self->$sub($action);
}
}
}
Hooks are run in the order they're added.
+The hooks receive a single parameter: the name of the action that is
+about to be called (for C<before> hooks) / was called (for C<after>
+hooks).
+
The return value of the hooks is discarded.
Hooks can be defined to run for all actions, for only specific actions