Acme-Web20-Validator
view release on metacpan or search on metacpan
}
1;
METHODS
new
my $v = Acme::Web20::Validator->new;
Creates and returns a validator instance.
add_rule
$v->add_rule(
'Acme::Web20::Validator::Rule::HasAnyFees',
'Acme::Web20::Validator::Rule::UseCatalyst',
)
Adds validation rules to the validator.
set_all_rules
$v->set_all_rules;
Adds Acme::Web20::Validator::Rule::* to the validator.
validate
my @rules = $v->validate($url);
print $rules[0]->name;
print $rules[0]->is_ok ? 'Yes!' : 'No';
Validates the website and returns rules which know the result of each
validation and rule's description.
validation_report
print $v->validation_report($url)
## OR
$v->validate($url);
print $v->validation_report;
Returns a validation report formatted by Text::ASCIITable.
rules_size
Returns a number of rules validator has.
ok_count
Returns a number of OK after validation.
clear
$v->validation_report($url[0]);
$v->clear;
$v->validation_report($url[1]);
$v->clear;
...
Clears validation result in the instance for reusing. If you want to
validate for other rules, create a new instance instead of reusing them.
SEE ALSO
Module::Pluggable
AUTHOR
Naoya Ito, <naoya@bloghackers.net>
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
( run in 3.218 seconds using v1.01-cache-2.11-cpan-5837b0d9d2c )