.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Validation::Class::Simple 3pm" .TH Validation::Class::Simple 3pm "2017-11-24" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Validation::Class::Simple \- Simple Ad\-Hoc Data Validation .SH "VERSION" .IX Header "VERSION" version 7.900057 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Validation::Class::Simple; \& \& my $params = { \& name => \*(AqRoot\*(Aq, \& email => \*(Aqroot@localhost\*(Aq, \& pass => \*(Aqs3cret\*(Aq, \& pass2 => \*(Aqs2cret\*(Aq \& }; \& \& # 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 => \*(Aqpass\*(Aq }, \& } \& ); \& \& # set parameters to be validated \& $rules\->params\->add($params); \& \& # validate \& unless ($rules\->validate) { \& # handle the failures \& warn $rules\->errors_to_string; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Validation::Class::Simple is a simple validation module built around the powerful Validation::Class data validation framework. .PP 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). .PP 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. .SH "QUICKSTART" .IX Header "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 \&\*(L"GUIDED-TOUR\*(R" in Validation::Class::Cookbook for a detailed step-by-step look into how Validation::Class works. .SH "RATIONALE" .IX Header "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. .SH "PROXY METHODS" .IX Header "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. .PP 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. .SS "class" .IX Subsection "class" .Vb 1 \& $self\->class; .Ve .PP See \*(L"class\*(R" in Validation::Class::Prototype for full documentation. .SS "clear_queue" .IX Subsection "clear_queue" .Vb 1 \& $self\->clear_queue; .Ve .PP See \*(L"clear_queue\*(R" in Validation::Class::Prototype for full documentation. .SS "error_count" .IX Subsection "error_count" .Vb 1 \& $self\->error_count; .Ve .PP See \*(L"error_count\*(R" in Validation::Class::Prototype for full documentation. .SS "error_fields" .IX Subsection "error_fields" .Vb 1 \& $self\->error_fields; .Ve .PP See \*(L"error_fields\*(R" in Validation::Class::Prototype for full documentation. .SS "errors" .IX Subsection "errors" .Vb 1 \& $self\->errors; .Ve .PP See \*(L"errors\*(R" in Validation::Class::Prototype for full documentation. .SS "errors_to_string" .IX Subsection "errors_to_string" .Vb 1 \& $self\->errors_to_string; .Ve .PP See \*(L"errors_to_string\*(R" in Validation::Class::Prototype for full documentation. .SS "get_errors" .IX Subsection "get_errors" .Vb 1 \& $self\->get_errors; .Ve .PP See \*(L"get_errors\*(R" in Validation::Class::Prototype for full documentation. .SS "get_fields" .IX Subsection "get_fields" .Vb 1 \& $self\->get_fields; .Ve .PP See \*(L"get_fields\*(R" in Validation::Class::Prototype for full documentation. .SS "get_hash" .IX Subsection "get_hash" .Vb 1 \& $self\->get_hash; .Ve .PP See \*(L"get_hash\*(R" in Validation::Class::Prototype for full documentation. .SS "get_params" .IX Subsection "get_params" .Vb 1 \& $self\->get_params; .Ve .PP See \*(L"get_params\*(R" in Validation::Class::Prototype for full documentation. .SS "get_values" .IX Subsection "get_values" .Vb 1 \& $self\->get_values; .Ve .PP See \*(L"get_values\*(R" in Validation::Class::Prototype for full documentation. .SS "fields" .IX Subsection "fields" .Vb 1 \& $self\->fields; .Ve .PP See \*(L"fields\*(R" in Validation::Class::Prototype for full documentation. .SS "filtering" .IX Subsection "filtering" .Vb 1 \& $self\->filtering; .Ve .PP See \*(L"filtering\*(R" in Validation::Class::Prototype for full documentation. .SS "ignore_failure" .IX Subsection "ignore_failure" .Vb 1 \& $self\->ignore_failure; .Ve .PP See \*(L"ignore_failure\*(R" in Validation::Class::Prototype for full documentation. .SS "ignore_unknown" .IX Subsection "ignore_unknown" .Vb 1 \& $self\->ignore_unknown; .Ve .PP See \*(L"ignore_unknown\*(R" in Validation::Class::Prototype for full documentation. .SS "is_valid" .IX Subsection "is_valid" .Vb 1 \& $self\->is_valid; .Ve .PP See \*(L"is_valid\*(R" in Validation::Class::Prototype for full documentation. .SS "param" .IX Subsection "param" .Vb 1 \& $self\->param; .Ve .PP See \*(L"param\*(R" in Validation::Class::Prototype for full documentation. .SS "params" .IX Subsection "params" .Vb 1 \& $self\->params; .Ve .PP See \*(L"params\*(R" in Validation::Class::Prototype for full documentation. .SS "plugin" .IX Subsection "plugin" .Vb 1 \& $self\->plugin; .Ve .PP See \*(L"plugin\*(R" in Validation::Class::Prototype for full documentation. .SS "queue" .IX Subsection "queue" .Vb 1 \& $self\->queue; .Ve .PP See \*(L"queue\*(R" in Validation::Class::Prototype for full documentation. .SS "report_failure" .IX Subsection "report_failure" .Vb 1 \& $self\->report_failure; .Ve .PP See \*(L"report_failure\*(R" in Validation::Class::Prototype for full documentation. .SS "report_unknown" .IX Subsection "report_unknown" .Vb 1 \& $self\->report_unknown; .Ve .PP See \*(L"report_unknown\*(R" in Validation::Class::Prototype for full documentation. .SS "reset_errors" .IX Subsection "reset_errors" .Vb 1 \& $self\->reset_errors; .Ve .PP See \*(L"reset_errors\*(R" in Validation::Class::Prototype for full documentation. .SS "reset_fields" .IX Subsection "reset_fields" .Vb 1 \& $self\->reset_fields; .Ve .PP See \*(L"reset_fields\*(R" in Validation::Class::Prototype for full documentation. .SS "reset_params" .IX Subsection "reset_params" .Vb 1 \& $self\->reset_params; .Ve .PP See \*(L"reset_params\*(R" in Validation::Class::Prototype for full documentation. .SS "set_errors" .IX Subsection "set_errors" .Vb 1 \& $self\->set_errors; .Ve .PP See \*(L"set_errors\*(R" in Validation::Class::Prototype for full documentation. .SS "set_fields" .IX Subsection "set_fields" .Vb 1 \& $self\->set_fields; .Ve .PP See \*(L"set_fields\*(R" in Validation::Class::Prototype for full documentation. .SS "set_params" .IX Subsection "set_params" .Vb 1 \& $self\->set_params; .Ve .PP See \*(L"set_params\*(R" in Validation::Class::Prototype for full documentation. .SS "set_method" .IX Subsection "set_method" .Vb 1 \& $self\->set_method; .Ve .PP See \*(L"set_method\*(R" in Validation::Class::Prototype for full documentation. .SS "stash" .IX Subsection "stash" .Vb 1 \& $self\->stash; .Ve .PP See \*(L"stash\*(R" in Validation::Class::Prototype for full documentation. .SS "validate" .IX Subsection "validate" .Vb 1 \& $self\->validate; .Ve .PP See \*(L"validate\*(R" in Validation::Class::Prototype for full documentation. .SS "validate_document" .IX Subsection "validate_document" .Vb 1 \& $self\->validate_document; .Ve .PP See \*(L"validate_document\*(R" in Validation::Class::Prototype for full documentation. .SS "validate_method" .IX Subsection "validate_method" .Vb 1 \& $self\->validate_method; .Ve .PP See \*(L"validate_method\*(R" in Validation::Class::Prototype for full documentation. .SS "validate_profile" .IX Subsection "validate_profile" .Vb 1 \& $self\->validate_profile; .Ve .PP See \*(L"validate_profile\*(R" in Validation::Class::Prototype for full documentation. .SH "EXTENSIBILITY" .IX Header "EXTENSIBILITY" Validation::Class does \s-1NOT\s0 provide method modifiers but can be easily extended with Class::Method::Modifiers. .SS "before" .IX Subsection "before" .Vb 1 \& before foo => sub { ... }; .Ve .PP See \*(L"before method(s) => sub { ... }\*(R" in Class::Method::Modifiers for full documentation. .SS "around" .IX Subsection "around" .Vb 1 \& around foo => sub { ... }; .Ve .PP See \*(L"around method(s) => sub { ... }\*(R" in Class::Method::Modifiers for full documentation. .SS "after" .IX Subsection "after" .Vb 1 \& after foo => sub { ... }; .Ve .PP See \*(L"after method(s) => sub { ... }\*(R" in Class::Method::Modifiers for full documentation. .SH "AUTHOR" .IX Header "AUTHOR" Al Newkirk .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2011 by Al Newkirk. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.