Data::Transpose::Validator::Base - Base class for Data::Transpose::Validator
my $v = Data::Transpose::Validator::Base->new; ok($v->is_valid("string"), "A string is valid"); ok($v->is_valid([]), "Empty array is valid"); ok($v->is_valid({}), "Empty hash is valid"); ok(!$v->is_valid(undef), "undef is not valid");
Constructor. It accepts an hash with the options.
Set or retrieve the required option. Returns true if required, false otherwise.
Set or retrieve the Data::Transpose::Validator options. Given that the various classes have a different way to initialize the objects, this should be done only once the object has been built.
E.g.
my $obj = $class->new(%classoptions); $obj->dtv_options(\%dtv_options);
On transposing, the value of the field is stored here.
Delete the dtv_value from the object
Main method. Return true if the variable passed is defined, false if it's undefined, storing an error.
Main method to check why the validator returned false. When an argument is provided, set the error.
In scalar context it returns a human-readable string with the errors.
In list context it returns the raw error list, where each element is a pair of code and strings.
Clear the errors stored.
Returns the list of the error codes for the current validation.
Set or retrieve a list of warnings issued by the validator.
Reset the warning list.
To install Data::Transpose, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Transpose
CPAN shell
perl -MCPAN -e shell install Data::Transpose
For more information on module installation, please visit the detailed CPAN module installation guide.