From: Chris Prather Date: Fri, 27 Mar 2009 21:15:32 +0000 (-0400) Subject: now with documentation X-Git-Tag: 0.73_01~45^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e451e85524aea53c921953c31262d9c9b5d0119d;p=gitmo%2FMoose.git now with documentation --- diff --git a/lib/Moose/Util/TypeConstraints.pm b/lib/Moose/Util/TypeConstraints.pm index 97f5669..b45ded1 100644 --- a/lib/Moose/Util/TypeConstraints.pm +++ b/lib/Moose/Util/TypeConstraints.pm @@ -996,6 +996,22 @@ metaclass L. Creates a type constraint for either C or something of the given type. +=item B + +This will create a subtype of Object and test to make sure the value C +do the methods in C<@methods> + +=item B + +If passed an ARRRAY reference instead of the C<$name>, C<@methods> pair, this +will create an unnamed duck type. This can be used in an attribute definiton +like so: + + has 'cache' => ( + is => 'ro', + isa => duck_type([qw[ get_set ]]), + ); + =item B This will create a basic subtype for a given set of strings.