From: Ricardo Signes Date: Fri, 22 Oct 2010 23:59:04 +0000 (-0400) Subject: docs for assert_coerce X-Git-Tag: 1.18~71 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=572b51876bd1cdc8fdf46cd029ccd72ae20f6c13;p=gitmo%2FMoose.git docs for assert_coerce --- diff --git a/lib/Moose/Meta/TypeConstraint.pm b/lib/Moose/Meta/TypeConstraint.pm index 00a8a0f..cd945e2 100644 --- a/lib/Moose/Meta/TypeConstraint.pm +++ b/lib/Moose/Meta/TypeConstraint.pm @@ -405,6 +405,14 @@ C and C. This will attempt to coerce the value to the type. If the type does have any defined coercions this will throw an error. +If no coercion can produce a value matching C<$constraint>, the original +value is returned. + +=item B<< $constraint->assert_coerce($value >> + +This method behaves just like C, but if the result is not valid +according to C<$constraint>, an error is thrown. + =item B<< $constraint->check($value) >> Returns true if the given value passes the constraint for the type.