NAME

Sub::Contract::ArgumentChecks - Hold validation conditions 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 element of this list might describe 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.2 2008/04/25 14:01:52 erwan_lemonnier Exp $

AUTHOR

Erwan Lemonnier <erwan@cpan.org>

LICENSE

See Sub::Contract.