
Antispam::Toolkit::Role::ContentChecker - A role for classes which check whether a piece of content is spam

version 0.08

package MyContentChecker;
use Moose;
with 'Antispam::Toolkit::Role::ContentChecker';
sub check_content { ... }

This role specifies an interface for classes which check whether a piece of content is spam.

This role provides one attribute:
This is an array reference of non-empty strings. Each string should be a MIME type. This attribute cannot be set by the constructor. The class consuming the role must provide a $checker->_build_accepted_content_types() method.

Classes which consume this method must provide two methods:
This method should return an array reference of mime types which the class can check, such as "text/html", "text/plain", etc.
This method implements the actual spam checking for a piece of content. It must accept the following named parameters:
The MIME type for the piece of content.
The content itself. This must be a non-empty string.

This role provides an around modifier for the $checker->check_content() method. The modifier does validation on all the parameters, so there's no need to implement this in the class itself.
If the provided content_type is not one of the accepted types, the original method will not be called.

See Antispam::Toolkit for bug reporting details.

Dave Rolsky <autarch@urth.org>

This software is Copyright (c) 2011 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)