GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Validation::Class::Simple(3) User Contributed Perl Documentation Validation::Class::Simple(3)

Validation::Class::Simple - Simple Ad-Hoc Data Validation

version 7.900057

    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;
    }

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.

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.

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.

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.

    $self->class;

See "class" in Validation::Class::Prototype for full documentation.

    $self->clear_queue;

See "clear_queue" in Validation::Class::Prototype for full documentation.

    $self->error_count;

See "error_count" in Validation::Class::Prototype for full documentation.

    $self->error_fields;

See "error_fields" in Validation::Class::Prototype for full documentation.

    $self->errors;

See "errors" in Validation::Class::Prototype for full documentation.

    $self->errors_to_string;

See "errors_to_string" in Validation::Class::Prototype for full documentation.

    $self->get_errors;

See "get_errors" in Validation::Class::Prototype for full documentation.

    $self->get_fields;

See "get_fields" in Validation::Class::Prototype for full documentation.

    $self->get_hash;

See "get_hash" in Validation::Class::Prototype for full documentation.

    $self->get_params;

See "get_params" in Validation::Class::Prototype for full documentation.

    $self->get_values;

See "get_values" in Validation::Class::Prototype for full documentation.

    $self->fields;

See "fields" in Validation::Class::Prototype for full documentation.

    $self->filtering;

See "filtering" in Validation::Class::Prototype for full documentation.

    $self->ignore_failure;

See "ignore_failure" in Validation::Class::Prototype for full documentation.

    $self->ignore_unknown;

See "ignore_unknown" in Validation::Class::Prototype for full documentation.

    $self->is_valid;

See "is_valid" in Validation::Class::Prototype for full documentation.

    $self->param;

See "param" in Validation::Class::Prototype for full documentation.

    $self->params;

See "params" in Validation::Class::Prototype for full documentation.

    $self->plugin;

See "plugin" in Validation::Class::Prototype for full documentation.

    $self->queue;

See "queue" in Validation::Class::Prototype for full documentation.

    $self->report_failure;

See "report_failure" in Validation::Class::Prototype for full documentation.

    $self->report_unknown;

See "report_unknown" in Validation::Class::Prototype for full documentation.

    $self->reset_errors;

See "reset_errors" in Validation::Class::Prototype for full documentation.

    $self->reset_fields;

See "reset_fields" in Validation::Class::Prototype for full documentation.

    $self->reset_params;

See "reset_params" in Validation::Class::Prototype for full documentation.

    $self->set_errors;

See "set_errors" in Validation::Class::Prototype for full documentation.

    $self->set_fields;

See "set_fields" in Validation::Class::Prototype for full documentation.

    $self->set_params;

See "set_params" in Validation::Class::Prototype for full documentation.

    $self->set_method;

See "set_method" in Validation::Class::Prototype for full documentation.

    $self->stash;

See "stash" in Validation::Class::Prototype for full documentation.

    $self->validate;

See "validate" in Validation::Class::Prototype for full documentation.

    $self->validate_document;

See "validate_document" in Validation::Class::Prototype for full documentation.

    $self->validate_method;

See "validate_method" in Validation::Class::Prototype for full documentation.

    $self->validate_profile;

See "validate_profile" in Validation::Class::Prototype for full documentation.

Validation::Class does NOT provide method modifiers but can be easily extended with Class::Method::Modifiers.

    before foo => sub { ... };

See "before method(s) => sub { ... }" in Class::Method::Modifiers for full documentation.

    around foo => sub { ... };

See "around method(s) => sub { ... }" in Class::Method::Modifiers for full documentation.

    after foo => sub { ... };

See "after method(s) => sub { ... }" in Class::Method::Modifiers for full documentation.

Al Newkirk <anewkirk@ana.io>

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.

2015-10-21 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.