NAME

Moose::Meta::TypeConstraint - The Moose Type Constraint metaclass

DESCRIPTION

For the most part, the only time you will ever encounter an instance of this class is if you are doing some serious deep introspection. This API should not be considered final, but it is highly unlikely that this will matter to a regular Moose user.

If you wish to use features at this depth, please come to the #moose IRC channel on irc.perl.org and we can talk :)

METHODS

meta
new
is_a_type_of ($type_name)

This checks the current type name, and if it does not match, checks if it is a subtype of it.

is_subtype_of ($type_name)
compile_type_constraint
coerce ($value)

This will apply the type-coercion if applicable.

check ($value)

This method will return a true (1) if the $value passes the constraint, and false (0) otherwise.

validate ($value)

This method is similar to check, but it deals with the error message. If the $value passes the constraint, undef will be returned. If the $value does not pass the constraint, then the message will be used to construct a custom error message.

name
parent
has_parent
constraint
has_message
message
has_coercion
coercion
hand_optimized_type_constraint
has_hand_optimized_type_constraint

DEPRECATED METHOD

union

This was just bad idea on my part,.. use the Moose::Meta::TypeConstraint::Union itself instead.

BUGS

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Stevan Little <stevan@iinteractive.com>

COPYRIGHT AND LICENSE

Copyright 2006, 2007 by Infinity Interactive, Inc.

http://www.iinteractive.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.