Helps define new hooks, hold hooks, and accessors to get and use hooks.
hooks
intenal use
invoke_hook()
invoke a hook
Hooks$invoke_hook(hook_type, args)
hook_type
(character) Hook name
args
(named list) Args passed when invoking a hook
executes hook
clear_hooks()
clear all hooks
Hooks$clear_hooks()
no return
define_hook()
define a hook
Hooks$define_hook(hook_type, fun, prepend = FALSE)
hook_type
(character) Hook name
fun
A function
prepend
(logical) Whether to prepend or add to the end
of the string. Default: FALSE
no return; defines hook internally
clone()
The objects of this class are cloneable with this method.
Hooks$clone(deep = FALSE)
deep
Whether to make a deep clone.
Private Methods
make_hook(x, plac, fun)
Make a hook. - x (character) Hook name - plac Placement, one of "start" or "end" - fun a function/callback