Muster::Hook - Muster hook base class
version 0.62
# CamelCase plugin name package Muster::Hook::MyHook; use Mojo::Base 'Muster::Hook'; sub register { my $self = shift; my $hookmaster = shift; my $conf = $shift; return $self; } sub process { my $self = shift; my %args = @_; # Magic here! :) return $leaf; }
Muster::Hook is an abstract base class for Muster hooks.
A hook will be used in both the scanning phase and the assembly phase, so it needs to be told which it is.
Muster::Hook inherits all methods from Mojo::Base and implements the following new ones.
Initialize, and register hooks.
Process (scan or modify) a leaf object. In scanning phase, it may update the meta-data, in modify phase, it may update the content. May leave the leaf untouched.
my $new_leaf = $self->process(leaf=>$leaf,phase=>$phase);
To install Muster, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Muster
CPAN shell
perl -MCPAN -e shell install Muster
For more information on module installation, please visit the detailed CPAN module installation guide.