From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

NAME

Muster::Hook - Muster hook base class

VERSION

version 0.92

SYNOPSIS

# CamelCase plugin name
sub register {
my $self = shift;
my $hookmaster = shift;
my $conf = $shift;
return $self;
}
sub process {
my $self = shift;
my %args = @_;
# Magic here! :)
return $leaf;
}

DESCRIPTION

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.

METHODS

Muster::Hook inherits all methods from Mojo::Base and implements the following new ones.

register

Initialize, and register hooks.

register_filter

Initialize, and register HTML-filters.

process

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);