NAME
Message::Stack::Parser::DataVerifier - Add messages to a Message::Stack from a Data::Verifier results
SYNOPSIS
use Message::Stack::Parser::DataVerifier;
# Pass a Data::Verifier::Results object to parse.
my $ms = Message::Stack::Parser::DataVerifier->new->parse(
Message::Stack->new,
$scope,
$dv_results
);
DESCRIPTION
This class will add a message to the provided Message::Stack for every missing or invalid field in a Data::Verifier::Result.
The fields are mapped from Data::Verifier into a Message in the following way:
Missing Fields
Invalid Fields
- id =
"invalid_$fieldname"
- scope = The passed in scope
- subject =
$fieldname
- level = 'error'
- params = The original value (that provided by the user) for the field.
METHODS
parse ($stack, $scope, $results)
Adds messages from the provided $results
to the provided $stack
under the $scope
that is passed in.
AUTHOR
Cory G Watson, <gphat at cpan.org>
COPYRIGHT & LICENSE
Copyright 2010 Cory G Watson.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.