Bubblegum::Constraints - Type and Constraints Library for Bubblegum
version 0.45
package Server; use Bubblegum::Class; use Bubblegum::Constraints 'typeof_arrayref'; has 'ifaces' => ( is => 'ro', isa => typeof_arrayref, required => 1 );
Bubblegum::Constraints is the standard type-checking library for Bubblegum applications with a focus on minimalism and data integrity. This library derives its type validation from Types::Standard, the Type::Tiny standard library. Note: This is an early release available for testing and feedback and as such is subject to change.
By default, no functions are exported when using this package, all functionality desired will need to be explicitly requested, and because many functions belong to a particular group of functions there are export tags which can be used to export sets of functions by group name. Any function can also be exported individually. The following are a list of functions and groups currently available:
The all export group exports all functions from the "-types", "-typesof", "-isas", and "-nots" export groups.
The isas export group exports all functions which have the isa_ prefix. These functions take a single argument and perform non-fatal type checking and return true or false. The following is a list of functions exported by this group:
isa_
isa_aref '...';
The isa_aref function validates that the argument is an array reference. If the argument is not an array reference, the function will return false.
isa_arrayref '...';
The isa_arrayref function validates that the argument is an array reference. If the argument is not an array reference, the function will return false.
isa_bool '...';
The isa_bool function validates that the argument is a boolean value. If the argument is not a boolean value, the function will return false.
isa_boolean '...';
The isa_boolean function validates that the argument is a boolean value. If the argument is not a boolean value, the function will return false.
isa_class '...';
The isa_class function validates that the argument is a class name. If the argument is not a class name, the function will return false.
isa_classname '...';
The isa_classname function validates that the argument is a class name. If the argument is not a class name, the function will return false.
isa_coderef '...';
The isa_coderef function validates that the argument is a code reference. If the argument is not a code reference, the function will return false.
isa_cref '...';
The isa_cref function validates that the argument is a code reference. If the argument is not a code reference, the function will return false.
isa_def '...';
The isa_def function validates that the argument is a defined value. If the argument is not a defined value, the function will return false.
isa_defined '...';
The isa_defined function validates that the argument is a defined value. If the argument is not a defined value, the function will return false.
isa_fh '...';
The isa_fh function validates that the argument is a file handle. If the argument is not a file handle, the function will return false.
isa_filehandle '...';
The isa_filehandle function validates that the argument is a file handle. If the argument is not a file handle, the function will return false.
isa_glob '...';
The isa_glob function validates that the argument is a glob reference. If the argument is not a glob reference, the function will return false.
isa_globref '...';
The isa_globref function validates that the argument is a glob reference. If the argument is not a glob reference, the function will return false.
isa_hashref '...';
The isa_hashref function validates that the argument is a hash reference. If the argument is not a hash reference, the function will return false.
isa_href '...';
The isa_href function validates that the argument is a hash reference. If the argument is not a hash reference, the function will return false.
isa_int '...';
The isa_int function validates that the argument is an integer. If the argument is not an integer, the function will return false.
isa_integer '...';
The isa_integer function validates that the argument is an integer. If the argument is not an integer, the function will return false.
isa_num '...';
The isa_num function validates that the argument is a number. If the argument is not a number, the function will return false.
isa_number '...';
The isa_number function validates that the argument is a number. If the argument is not a number, the function will return false.
isa_obj '...';
The isa_obj function validates that the argument is an object. If the argument is not an object, the function will return false.
isa_object '...';
The isa_object function validates that the argument is an object. If the argument is not an object, the function will return false.
isa_ref '...';
The isa_ref function validates that the argument is a reference. If the argument is not a reference, the function will return false.
isa_reference '...';
The isa_reference function validates that the argument is a reference. If the argument is not a reference, the function will return false.
isa_regexpref '...';
The isa_regexpref function validates that the argument is a regular expression reference. If the argument is not a regular expression reference, the function will return false.
isa_rref '...';
The isa_rref function validates that the argument is a regular expression reference. If the argument is not a regular expression reference, the function will return false.
isa_scalarref '...';
The isa_scalarref function validates that the argument is a scalar reference. If the argument is not a scalar reference, the function will return false.
isa_sref '...';
The isa_sref function validates that the argument is a scalar reference. If the argument is not a scalar reference, the function will return false.
isa_str '...';
The isa_str function validates that the argument is a string. If the argument is not a string, the function will return false.
isa_string '...';
The isa_string function validates that the argument is a string. If the argument is not a string, the function will return false.
isa_nil '...';
The isa_nil function validates that the argument is an undefined value. If the argument is not an undefined value, the function will return false.
isa_null '...';
The isa_null function validates that the argument is an undefined value. If the argument is not an undefined value, the function will return false.
isa_undef '...';
The isa_undef function validates that the argument is an undefined value. If the argument is not an undefined value, the function will return false.
isa_undefined '...';
The isa_undefined function validates that the argument is an undefined value. If the argument is not an undefined value, the function will return false.
isa_val '...';
The isa_val function validates that the argument is a value. If the argument is not a value, the function will return false.
isa_value '...';
The isa_value function validates that the argument is a value. If the argument is not a value, the function will return false.
The nots export group exports all functions which have the not_ prefix. These functions take a single argument and perform non-fatal negated type checking and return true or false. The following is a list of functions exported by this group:
not_
not_aref '...';
The not_aref function validates that the argument is NOT an array reference. If the argument is an array reference, the function will return false.
not_arrayref '...';
The not_arrayref function validates that the argument is NOT an array reference. If the argument is an array reference, the function will return false.
not_bool '...';
The not_bool function validates that the argument is NOT a boolean value. If the argument is a boolean value, the function will return false.
not_boolean '...';
The not_boolean function validates that the argument is NOT a boolean value. If the argument is a boolean value, the function will return false.
not_class '...';
The not_class function validates that the argument is NOT a class name. If the argument is a class name, the function will return false.
not_classname '...';
The not_classname function validates that the argument is NOT a class name. If the argument is a class name, the function will return false.
not_coderef '...';
The not_coderef function validates that the argument is NOT a code reference. If the argument is a code reference, the function will return false.
not_cref '...';
The not_cref function validates that the argument is NOT a code reference. If the argument is a code reference, the function will return false.
not_def '...';
The not_def function validates that the argument is NOT a defined value. If the argument is a defined value, the function will return false.
not_defined '...';
The not_defined function validates that the argument is NOT a defined value. If the argument is a defined value, the function will return false.
not_fh '...';
The not_fh function validates that the argument is NOT a file handle. If the argument is a file handle, the function will return false.
not_filehandle '...';
The not_filehandle function validates that the argument is NOT a file handle. If the argument is a file handle, the function will return false.
not_glob '...';
The not_glob function validates that the argument is NOT a glob reference. If the argument is a glob reference, the function will return false.
not_globref '...';
The not_globref function validates that the argument is NOT a glob reference. If the argument is a glob reference, the function will return false.
not_hashref '...';
The not_hashref function validates that the argument is NOT a hash reference. If the argument is a hash reference, the function will return false.
not_href '...';
The not_href function validates that the argument is NOT a hash reference. If the argument is a hash reference, the function will return false.
not_int '...';
The not_int function validates that the argument is NOT an integer. If the argument is an integer, the function will return false.
not_integer '...';
The not_integer function validates that the argument is NOT an integer. If the argument is an integer, the function will return false.
not_num '...';
The not_num function validates that the argument is NOT a number. If the argument is a number, the function will return false.
not_number '...';
The not_number function validates that the argument is NOT a number. If the argument is a number, the function will return false.
not_obj '...';
The not_obj function validates that the argument is NOT an object. If the argument is an object, the function will return false.
not_object '...';
The not_object function validates that the argument is NOT an object. If the argument is an object, the function will return false.
not_ref '...';
The not_ref function validates that the argument is NOT a reference. If the argument is a reference, the function will return false.
not_reference '...';
The not_reference function validates that the argument is NOT a reference. If the argument is a reference, the function will return false.
not_regexpref '...';
The not_regexpref function validates that the argument is NOT a regular expression reference. If the argument is a regular expression reference, the function will return false.
not_rref '...';
The not_rref function validates that the argument is NOT a regular expression reference. If the argument is a regular expression reference, the function will return false.
not_scalarref '...';
The not_scalarref function validates that the argument is NOT a scalar reference. If the argument is a scalar reference, the function will return false.
not_sref '...';
The not_sref function validates that the argument is NOT a scalar reference. If the argument is a scalar reference, the function will return false.
not_str '...';
The not_str function validates that the argument is NOT a string. If the argument is a string, the function will return false.
not_string '...';
The not_string function validates that the argument is NOT a string. If the argument is a string, the function will return false.
not_nil '...';
The not_nil function validates that the argument is NOT an undefined value. If the argument is an undefined value, the function will return false.
not_null '...';
The not_null function validates that the argument is NOT an undefined value. If the argument is an undefined value, the function will return false.
not_undef '...';
The not_undef function validates that the argument is NOT an undefined value. If the argument is an undefined value, the function will return false.
not_undefined '...';
The not_undefined function validates that the argument is NOT an undefined value. If the argument is an undefined value, the function will return false.
not_val '...';
The not_val function validates that the argument is NOT a value. If the argument is a value, the function will return false.
not_value '...';
The not_value function validates that the argument is NOT a value. If the argument is a value, the function will return false.
The types export group exports all functions which have the type_ prefix. These functions take a single argument/expression and perform fatal type checking operation returning the argument/expression if successful. The follow is a list of functions exported by this group:
type_
type_aref '...';
The type_aref function asserts that the argument is an array reference. If the argument is not an array reference, the function will cause the program to die.
type_arrayref '...';
The type_arrayref function asserts that the argument is an array reference. If the argument is not an array reference, the function will cause the program to die.
type_bool '...';
The type_bool function asserts that the argument is a boolean value. If the argument is not a boolean value, the function will cause the program to die.
type_boolean '...';
The type_boolean function asserts that the argument is a boolean value. If the argument is not a boolean value, the function will cause the program to die.
type_class '...';
The type_class function asserts that the argument is a class name. If the argument is not a class name, the function will cause the program to die.
type_classname '...';
The type_classname function asserts that the argument is a class name. If the argument is not a class name, the function will cause the program to die.
type_coderef '...';
The type_coderef function asserts that the argument is a code reference. If the argument is not a code reference, the function will cause the program to die.
type_cref '...';
The type_cref function asserts that the argument is a code reference. If the argument is not a code reference, the function will cause the program to die.
type_def '...';
The type_def function asserts that the argument is a defined value. If the argument is not a defined value, the function will cause the program to die.
type_defined '...';
The type_defined function asserts that the argument is a defined value. If the argument is not a defined value, the function will cause the program to die.
type_fh '...';
The type_fh function asserts that the argument is a file handle. If the argument is not a file handle, the function will cause the program to die.
type_filehandle '...';
The type_filehandle function asserts that the argument is a file handle. If the argument is not a file handle, the function will cause the program to die.
type_glob '...';
The type_glob function asserts that the argument is a glob reference. If the argument is not a glob reference, the function will cause the program to die.
type_globref '...';
The type_globref function asserts that the argument is a glob reference. If the argument is not a glob reference, the function will cause the program to die.
type_hashref '...';
The type_hashref function asserts that the argument is a hash reference. If the argument is not a hash reference, the function will cause the program to die.
type_href '...';
The type_href function asserts that the argument is a hash reference. If the argument is not a hash reference, the function will cause the program to die.
type_int '...';
The type_int function asserts that the argument is an integer. If the argument is not an integer, the function will cause the program to die.
type_integer '...';
The type_integer function asserts that the argument is an integer. If the argument is not an integer, the function will cause the program to die.
type_num '...';
The type_num function asserts that the argument is a number. If the argument is not a number, the function will cause the program to die.
type_number '...';
The type_number function asserts that the argument is a number. If the argument is not a number, the function will cause the program to die.
type_obj '...';
The type_obj function asserts that the argument is an object. If the argument is not an object, the function will cause the program to die.
type_object '...';
The type_object function asserts that the argument is an object. If the argument is not an object, the function will cause the program to die.
type_ref '...';
The type_ref function asserts that the argument is a reference. If the argument is not a reference, the function will cause the program to die.
type_reference '...';
The type_reference function asserts that the argument is a reference. If the argument is not a reference, the function will cause the program to die.
type_regexpref '...';
The type_regexpref function asserts that the argument is a regular expression reference. If the argument is not a regular expression reference, the function will cause the program to die.
type_rref '...';
The type_rref function asserts that the argument is a regular expression reference. If the argument is not a regular expression reference, the function will cause the program to die.
type_scalarref '...';
The type_scalarref function asserts that the argument is a scalar reference. If the argument is not a scalar reference, the function will cause the program to die.
type_sref '...';
The type_sref function asserts that the argument is a scalar reference. If the argument is not a scalar reference, the function will cause the program to die.
type_str '...';
The type_str function asserts that the argument is a string. If the argument is not a string, the function will cause the program to die.
type_string '...';
The type_string function asserts that the argument is a string. If the argument is not a string, the function will cause the program to die.
type_nil '...';
The type_nil function asserts that the argument is an undefined value. If the argument is not an undefined value, the function will cause the program to die.
type_null '...';
The type_null function asserts that the argument is an undefined value. If the argument is not an undefined value, the function will cause the program to die.
type_undef '...';
The type_undef function asserts that the argument is an undefined value. If the argument is not an undefined value, the function will cause the program to die.
type_undefined '...';
The type_undefined function asserts that the argument is an undefined value. If the argument is not an undefined value, the function will cause the program to die.
type_val '...';
The type_val function asserts that the argument is a value. If the argument is not a value, the function will cause the program to die.
type_value '...';
The type_value function asserts that the argument is a value. If the argument is not a value, the function will cause the program to die.
The typesof export group exports all functions which have the typeof_ prefix. These functions take no argument and return a type-validation code reference to be used with your object-system of choice. The following is a list of functions exported by this group:
typeof_
typeof_aref;
The typeof_aref function returns a type constraint in the form of a code reference which asserts that the argument is an array reference. If the argument is not an array reference, the function will cause the program to die.
typeof_arrayref;
The typeof_arrayref function returns a type constraint in the form of a code reference which asserts that the argument is an array reference. If the argument is not an array reference, the function will cause the program to die.
typeof_bool;
The typeof_bool function returns a type constraint in the form of a code reference which asserts that the argument is a boolean value. If the argument is not a boolean value, the function will cause the program to die.
typeof_boolean;
The typeof_boolean function returns a type constraint in the form of a code reference which asserts that the argument is a boolean value. If the argument is not a boolean value, the function will cause the program to die.
typeof_class;
The typeof_class function returns a type constraint in the form of a code reference which asserts that the argument is a class name. If the argument is not a class name, the function will cause the program to die.
typeof_classname;
The typeof_classname function returns a type constraint in the form of a code reference which asserts that the argument is a class name. If the argument is not a class name, the function will cause the program to die.
typeof_coderef;
The typeof_coderef function returns a type constraint in the form of a code reference which asserts that the argument is a code reference. If the argument is not a code reference, the function will cause the program to die.
typeof_cref;
The typeof_cref function returns a type constraint in the form of a code reference which asserts that the argument is a code reference. If the argument is not a code reference, the function will cause the program to die.
typeof_def;
The typeof_def function returns a type constraint in the form of a code reference which asserts that the argument is a defined value. If the argument is not a defined value, the function will cause the program to die.
typeof_defined;
The typeof_defined function returns a type constraint in the form of a code reference which asserts that the argument is a defined value. If the argument is not a defined value, the function will cause the program to die.
typeof_fh;
The typeof_fh function returns a type constraint in the form of a code reference which asserts that the argument is a file handle. If the argument is not a file handle, the function will cause the program to die.
typeof_filehandle;
The typeof_filehandle function returns a type constraint in the form of a code reference which asserts that the argument is a file handle. If the argument is not a file handle, the function will cause the program to die.
typeof_glob;
The typeof_glob function returns a type constraint in the form of a code reference which asserts that the argument is a glob reference. If the argument is not a glob reference, the function will cause the program to die.
typeof_globref;
The typeof_globref function returns a type constraint in the form of a code reference which asserts that the argument is a glob reference. If the argument is not a glob reference, the function will cause the program to die.
typeof_hashref;
The typeof_hashref function returns a type constraint in the form of a code reference which asserts that the argument is a hash reference. If the argument is not a hash reference, the function will cause the program to die.
typeof_href;
The typeof_href function returns a type constraint in the form of a code reference which asserts that the argument is a hash reference. If the argument is not a hash reference, the function will cause the program to die.
typeof_int;
The typeof_int function returns a type constraint in the form of a code reference which asserts that the argument is an integer. If the argument is not an integer, the function will cause the program to die.
typeof_integer;
The typeof_integer function returns a type constraint in the form of a code reference which asserts that the argument is an integer. If the argument is not an integer, the function will cause the program to die.
typeof_num;
The typeof_num function returns a type constraint in the form of a code reference which asserts that the argument is a number. If the argument is not a number, the function will cause the program to die.
typeof_number;
The typeof_number function returns a type constraint in the form of a code reference which asserts that the argument is a number. If the argument is not a number, the function will cause the program to die.
typeof_obj;
The typeof_obj function returns a type constraint in the form of a code reference which asserts that the argument is an object. If the argument is not an object, the function will cause the program to die.
typeof_object;
The typeof_object function returns a type constraint in the form of a code reference which asserts that the argument is an object. If the argument is not an object, the function will cause the program to die.
typeof_ref;
The typeof_ref function returns a type constraint in the form of a code reference which asserts that the argument is a reference. If the argument is not a reference, the function will cause the program to die.
typeof_reference;
The typeof_reference function returns a type constraint in the form of a code reference which asserts that the argument is a reference. If the argument is not a reference, the function will cause the program to die.
typeof_regexpref;
The typeof_regexpref function returns a type constraint in the form of a code reference which asserts that the argument is a regular expression reference. If the argument is not a regular expression reference, the function will cause the program to die.
typeof_rref;
The typeof_rref function returns a type constraint in the form of a code reference which asserts that the argument is a regular expression reference. If the argument is not a regular expression reference, the function will cause the program to die.
typeof_scalarref;
The typeof_scalarref function returns a type constraint in the form of a code reference which asserts that the argument is a scalar reference. If the argument is not a scalar reference, the function will cause the program to die.
typeof_sref;
The typeof_sref function returns a type constraint in the form of a code reference which asserts that the argument is a scalar reference. If the argument is not a scalar reference, the function will cause the program to die.
typeof_str;
The typeof_str function returns a type constraint in the form of a code reference which asserts that the argument is a string. If the argument is not a string, the function will cause the program to die.
typeof_string;
The typeof_string function returns a type constraint in the form of a code reference which asserts that the argument is a string. If the argument is not a string, the function will cause the program to die.
typeof_nil;
The typeof_nil function returns a type constraint in the form of a code reference which asserts that the argument is an undefined value. If the argument is not an undefined value, the function will cause the program to die.
typeof_null;
The typeof_null function returns a type constraint in the form of a code reference which asserts that the argument is an undefined value. If the argument is not an undefined value, the function will cause the program to die.
typeof_undef;
The typeof_undef function returns a type constraint in the form of a code reference which asserts that the argument is an undefined value. If the argument is not an undefined value, the function will cause the program to die.
typeof_undefined;
The typeof_undefined function returns a type constraint in the form of a code reference which asserts that the argument is an undefined value. If the argument is not an undefined value, the function will cause the program to die.
typeof_val;
The typeof_val function returns a type constraint in the form of a code reference which asserts that the argument is a value. If the argument is not a value, the function will cause the program to die.
typeof_value;
The typeof_value function returns a type constraint in the form of a code reference which asserts that the argument is a value. If the argument is not a value, the function will cause the program to die.
Al Newkirk <anewkirk@ana.io>
This software is copyright (c) 2013 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.
To install Bubblegum, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bubblegum
CPAN shell
perl -MCPAN -e shell install Bubblegum
For more information on module installation, please visit the detailed CPAN module installation guide.