table of contents
Validation::Class::Simple(3pm) | User Contributed Perl Documentation | Validation::Class::Simple(3pm) |
NAME¶
Validation::Class::Simple - Simple Ad-Hoc Data Validation
VERSION¶
version 7.900059
SYNOPSIS¶
use Validation::Class::Simple; my $params = { name => 'Root', email => 'root@localhost', pass => 's3cret', pass2 => 's2cret' }; # define object specific rules my $rules = Validation::Class::Simple->new( # define fields on-the-fly fields => { name => { required => 1 }, email => { required => 1 }, pass => { required => 1 }, pass2 => { required => 1, matches => 'pass' }, } ); # set parameters to be validated $rules->params->add($params); # validate unless ($rules->validate) { # handle the failures warn $rules->errors_to_string; }
DESCRIPTION¶
Validation::Class::Simple is a simple validation module built around the powerful Validation::Class data validation framework.
This module is merely a blank canvas, a clean validation class derived from Validation::Class which has not been pre-configured (e.g. configured via keywords, etc).
It can be useful in an environment where you wouldn't care to create a validation class and instead would simply like to pass rules to a validation engine in an ad-hoc fashion.
QUICKSTART¶
If you are looking for a data validation module with an even lower learning curve built using the same tenets and principles as Validation::Class which is as simple and even lazier than this module, please review the documentation for Validation::Class::Simple::Streamer. Please review the "GUIDED-TOUR" in Validation::Class::Cookbook for a detailed step-by-step look into how Validation::Class works.
RATIONALE¶
If you are new to Validation::Class, or would like more information on the underpinnings of this library and how it views and approaches data validation, please review Validation::Class::Whitepaper.
PROXY METHODS¶
Each instance of Validation::Class::Simple is associated with a prototype class which provides the data validation engine and keeps the class namespace free from pollution and collisions, please see Validation::Class::Prototype for more information on specific methods and attributes.
Validation::Class::Simple is injected with a few proxy methods which are basically aliases to the corresponding prototype (engine) class methods, however it is possible to access the prototype directly using the proto/prototype methods.
class¶
$self->class;
See "class" in Validation::Class::Prototype for full documentation.
clear_queue¶
$self->clear_queue;
See "clear_queue" in Validation::Class::Prototype for full documentation.
error_count¶
$self->error_count;
See "error_count" in Validation::Class::Prototype for full documentation.
error_fields¶
$self->error_fields;
See "error_fields" in Validation::Class::Prototype for full documentation.
errors¶
$self->errors;
See "errors" in Validation::Class::Prototype for full documentation.
errors_to_string¶
$self->errors_to_string;
See "errors_to_string" in Validation::Class::Prototype for full documentation.
get_errors¶
$self->get_errors;
See "get_errors" in Validation::Class::Prototype for full documentation.
get_fields¶
$self->get_fields;
See "get_fields" in Validation::Class::Prototype for full documentation.
get_hash¶
$self->get_hash;
See "get_hash" in Validation::Class::Prototype for full documentation.
get_params¶
$self->get_params;
See "get_params" in Validation::Class::Prototype for full documentation.
get_values¶
$self->get_values;
See "get_values" in Validation::Class::Prototype for full documentation.
fields¶
$self->fields;
See "fields" in Validation::Class::Prototype for full documentation.
filtering¶
$self->filtering;
See "filtering" in Validation::Class::Prototype for full documentation.
ignore_failure¶
$self->ignore_failure;
See "ignore_failure" in Validation::Class::Prototype for full documentation.
ignore_unknown¶
$self->ignore_unknown;
See "ignore_unknown" in Validation::Class::Prototype for full documentation.
is_valid¶
$self->is_valid;
See "is_valid" in Validation::Class::Prototype for full documentation.
param¶
$self->param;
See "param" in Validation::Class::Prototype for full documentation.
params¶
$self->params;
See "params" in Validation::Class::Prototype for full documentation.
plugin¶
$self->plugin;
See "plugin" in Validation::Class::Prototype for full documentation.
queue¶
$self->queue;
See "queue" in Validation::Class::Prototype for full documentation.
report_failure¶
$self->report_failure;
See "report_failure" in Validation::Class::Prototype for full documentation.
report_unknown¶
$self->report_unknown;
See "report_unknown" in Validation::Class::Prototype for full documentation.
reset_errors¶
$self->reset_errors;
See "reset_errors" in Validation::Class::Prototype for full documentation.
reset_fields¶
$self->reset_fields;
See "reset_fields" in Validation::Class::Prototype for full documentation.
reset_params¶
$self->reset_params;
See "reset_params" in Validation::Class::Prototype for full documentation.
set_errors¶
$self->set_errors;
See "set_errors" in Validation::Class::Prototype for full documentation.
set_fields¶
$self->set_fields;
See "set_fields" in Validation::Class::Prototype for full documentation.
set_params¶
$self->set_params;
See "set_params" in Validation::Class::Prototype for full documentation.
set_method¶
$self->set_method;
See "set_method" in Validation::Class::Prototype for full documentation.
stash¶
$self->stash;
See "stash" in Validation::Class::Prototype for full documentation.
validate¶
$self->validate;
See "validate" in Validation::Class::Prototype for full documentation.
validate_document¶
$self->validate_document;
See "validate_document" in Validation::Class::Prototype for full documentation.
validate_method¶
$self->validate_method;
See "validate_method" in Validation::Class::Prototype for full documentation.
validate_profile¶
$self->validate_profile;
See "validate_profile" in Validation::Class::Prototype for full documentation.
EXTENSIBILITY¶
Validation::Class does NOT provide method modifiers but can be easily extended with Class::Method::Modifiers.
before¶
before foo => sub { ... };
See "before method(s) => sub { ... }" in Class::Method::Modifiers for full documentation.
around¶
around foo => sub { ... };
See "around method(s) => sub { ... }" in Class::Method::Modifiers for full documentation.
after¶
after foo => sub { ... };
See "after method(s) => sub { ... }" in Class::Method::Modifiers for full documentation.
AUTHOR¶
Al Newkirk <anewkirk@ana.io>
COPYRIGHT AND LICENSE¶
This software is copyright (c) 2011 by Al Newkirk.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
2023-06-11 | perl v5.36.0 |