From: Dave Rolsky Date: Fri, 29 Aug 2008 17:38:05 +0000 (+0000) Subject: a little tweaking of t0m's doc changes X-Git-Tag: 0.55_02~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=be0d0ba8254553e0d12847fe191a106774ea87ac;p=gitmo%2FMoose.git a little tweaking of t0m's doc changes --- diff --git a/lib/Moose/Meta/TypeConstraint.pm b/lib/Moose/Meta/TypeConstraint.pm index 7f80067..770e003 100644 --- a/lib/Moose/Meta/TypeConstraint.pm +++ b/lib/Moose/Meta/TypeConstraint.pm @@ -282,22 +282,23 @@ If you wish to use features at this depth, please come to the =item B -This checks the current type against the supplied type (only). -Returns false either if the type name or object supplied -does not match, or if a type name isn't found in the type registry. +This checks the current type against the supplied type (only). +Returns false if the two types are not equal. It also returns false if +you provide the type as a name, and the type name isn't found in the +type registry. =item B This checks the current type against the supplied type, or if the -current type is a sub-type of the type name or object supplied. -Returns false if the current type is not descended from the supplied -type, of if the supplied type isn't found in the type registry. +current type is a sub-type of the type name or object supplied. It +also returns false if you provide the type as a name, and the type +name isn't found in the type registry. =item B -This checks the current type is a sub-type of the type name or object supplied. -Returns false if the current type is not descended from the supplied -type, of if the supplied type isn't found in the type registry. +This checks the current type is a sub-type of the type name or object +supplied. It also returns false if you provide the type as a name, and +the type name isn't found in the type registry. =item B @@ -323,11 +324,11 @@ The name of the type in the global type registry. =item B -The parent type of this type. +This type's parent type. =item B -If this type has a parent type. +Returns true if this type has a parent type. =item B diff --git a/lib/Moose/Util/TypeConstraints.pm b/lib/Moose/Util/TypeConstraints.pm index 76ffc6b..f7f5e59 100644 --- a/lib/Moose/Util/TypeConstraints.pm +++ b/lib/Moose/Util/TypeConstraints.pm @@ -857,18 +857,19 @@ This is just sugar for the type constraint construction syntax. This is just sugar for the type constraint construction syntax. -Takes a block/code ref as an argument. When the type constraint is tested, -the supplied code is run with the value to be tested in $_. Returning -a true value indicates that the type constraint passes, a false value -indicates that it failed. +Takes a block/code ref as an argument. When the type constraint is +tested, the supplied code is run with the value to be tested in +$_. This block should return true or false to indicate whether or not +the constraint check passed. =item B This is just sugar for the type constraint construction syntax. Takes a block/code ref as an argument. When the type constraint fails, -then the code block is run (with the value again in $_), and the value -returned is the text of the exception which is thrown. +then the code block is run (with the value provided in $_). This code +ref should return a string, which will be used in the text of the +exception thrown. =item B