NAME

Template::Plugin::StashValidate - MooseX::Params::Validate for template stash values

DESCRIPTION

Allows a template to validate specific hash keys via MooseX::Params::Validate

SYNOPSIS

[% USE StashValidate {
   'advice_discrepant' => { 'isa' => 'ArrayRef | HashRef', 'optional' => 1 },
 } %]

OVERVIEW

Allows a template to validate keys from the stash (Template::Stash) using MooseX::Params::Validate. Accepts a hashref as the sole argument, and this is the parameter_spec that's passed straight through to MooseX::Params::Validate's validated_hash. We only validate elements in the stash for which you've specified an allowed value - other keys in the stash are ignored.

In short, for options, see: MooseX::Params::Validate.

MooseX::Params::Validate supports both coerced values and default values - this means the value you put in might not be the value you get out again. This module supports that - the stash is updated with any changes returned.

METHODS

new

This is the method called when you say [% USE StashValidate {} %], as per the documentation in Template::Plugin.

AUTHOR

Peter Sergeant - pete@clueball.com, while working for Net-A-Porter.