Brick::General - constraints for domain-nonspecific stuff
use Brick;
A wrapper around __fields_are_something to supply the code reference to verify that each field for definedness. It takes the same input.
A wrapper around __fields_are_something to supply the code reference to verify that each field for true values. It takes the same input.
A wrapper around __fields_are_something to supply the code reference to verify that each field for false values. It takes the same input.
A wrapper around __fields_are_something to supply the code reference to verify that each field has blank values. It takes the same input.
A wrapper around _remove_extra_fields to remove anything not in the list of the key 'allowed_fields' in HASHREF.
This constraint only cares about fields that do not belong in the input. It does not, for instance, ensure that all the fields that should be there are. Use required fields for that.
A wrapper around _fields_are_defined_and_not_null_string to check for the presence of the required fields. A required field must exist in the input hash and have a defined value that is not the null string.
fields - an anonymous array of fields that must exist in input
If all of the fields satisfy the condition, it does not die. If some of the fields do not satisfy the condition, it dies with a hash reference whose keys are:
message - message about the error errors - anonymous array of fields that failed the condition handler - anonymous array of fields that satisfy the condition
If a code error occurs, it dies with a simple scalar.
Applies CODEREF to all of the fields in HASHREF->{fields}.
fields - an anonymous array of fields to apply CODEREF to description - a textual description of the test (has default) test_name - short (couple word) description of test (e.g. "defined")
Check that all fields in HASHREF->{fields) are defined and have a true value. See __fields_are_something for details.
Check that all fields in HASHREF->{fields) are defined. See __fields_are_something for details.
Check that all fields in HASHREF->{fields) are blank (either undefined or the empty string). See __fields_are_something for details.
Check that all fields in HASHREF->{fields) are false (in the Perl sense). See __fields_are_something for details.
Check that all fields in HASHREF->{fields) are true (in the Perl sense). See __fields_are_something for details.
TBA
This source is in Github:
https://github.com/briandfoy/brick
brian d foy, <bdfoy@cpan.org>
<bdfoy@cpan.org>
Copyright © 2007-2022, brian d foy <bdfoy@cpan.org>. All rights reserved.
You may redistribute this under the terms of the Artistic License 2.0.
To install Brick, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Brick
CPAN shell
perl -MCPAN -e shell install Brick
For more information on module installation, please visit the detailed CPAN module installation guide.