NAME
Sub::Contract::ArgumentChecks - Hold the constraints on input/return arguments
SYNOPSIS
See 'Sub::Contract'.
DESCRIPTION
An instance of Sub::Contract::ArgumentChecks holds the constraints for either the input arguments or the return results of a given subroutine.
Subroutine arguments in perl can be passed as a list of values, or as a hash, or as a list mixing both values and hash. In fact arguments are always passed as a list but the elements of this list might have to be considered as members of a hash after a given position in the list.
An instance of Sub::Contract::ArgumentChecks describe the contract conditions on any optional heading list arguments and any optional trailing hash arguments in a list of input or return values.
API
See 'Sub::Contract'.
- new()
- add_list_check()
-
Add a check for an argument passed in list-style. The order of calling
add_list_check
defines the position of that argument in the list. - add_hash_check()
-
Add a check for an argument passed in hash-style. The number of calls made to
add_list_check
defines where the hash starts in the list of arguments. - has_list_args()
-
Return true if there are conditions on arguments passed in list-style.
- has_hash_args()
-
Return true if there are conditions on arguments passed in hash-style.
SEE ALSO
See 'Sub::Contract'.
VERSION
$Id: ArgumentChecks.pm,v 1.8 2009/06/16 12:23:58 erwan_lemonnier Exp $
AUTHOR
Erwan Lemonnier <erwan@cpan.org>
LICENSE
See Sub::Contract.