NAME

MooX::PluginKit::Plugin - Setup a role as a PluginKit plugin.

SYNOPSIS

DESCRIPTION

This module, when used, exports several candy functions (see "CANDY") into the caller.

Some higher-level documentation about how to consume plugins can be found at "CREATING PLUGINS" in MooX::PluginKit.

CANDY

plugin_applies_to

# Only apply to classes which isa() the supplied class, or
# DOES() the supplied role.
plugin_applies_to 'Some::Class';
plugin_applies_to 'Some::Role';

# Only apply to classes which match the regex.
plugin_applies_to qr/^MyApp::Foo::/;

# Only apply to classes which implement these methods.
plugin_applies_to ['foo', 'bar'];

# Only apply to classes which pass this custom check.
plugin_applies_to sub{ $_[0]->does('Some::Role') }

Declares which types of classes this plugin may be applied to.

plugin_includes

plugin_includes 'Some::Plugin', '::Relative::Plugin';

Registers a plugin for inclusion with this plugin.

AUTHORS AND LICENSE

See "AUTHORS" in MooX::PluginKit and "LICENSE" in MooX::PluginKit.