From: Ricardo Signes Date: Wed, 3 Feb 2010 14:33:14 +0000 (-0500) Subject: docs for Map X-Git-Tag: 0.20~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Types-Structured.git;a=commitdiff_plain;h=249d5425a19e361f81159d179ed85214f175b13d docs for Map --- diff --git a/lib/MooseX/Types/Structured.pm b/lib/MooseX/Types/Structured.pm index 7e26c24..e85f3c1 100644 --- a/lib/MooseX/Types/Structured.pm +++ b/lib/MooseX/Types/Structured.pm @@ -500,6 +500,17 @@ hashref. For example: The keys in %constraints follow the same rules as @constraints in the above section. +=head2 Map[ $key_constraint, $value_constraint ] + +This defines a HashRef based constraint in which both the keys and values are +required to meet certain constraints. For example, to map hostnames to IP +addresses, you might say: + + Map[ HostName, IPAddress ] + +The type constraint would only be met if every key was a valid HostName and +every value was a valid IPAddress. + =head2 Optional[$constraint] This is primarily a helper constraint for Dict and Tuple type constraints. What