++ed by:
KJETILK FREW OVID MARIOROY JROBINSON

161 PAUSE users
137 non-PAUSE users.

Dave Rolsky
and 1 contributors

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
equals ($type_name_or_object)

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.

is_a_type_of ($type_name_or_object)

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. It also returns false if you provide the type as a name, and the type name isn't found in the type registry.

is_subtype_of ($type_name_or_object)

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.

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

The name of the type in the global type registry.

parent

This type's parent type.

has_parent

Returns true if this type has a parent type.

parents

Synonym for parent.

constraint

Returns this type's constraint. This is the value of where provided when defining a type.

has_message

Returns true if this type has a message.

message

Returns this type's message.

get_message ($value)

Generate message for $value.

has_coercion

Returns true if this type has a coercion.

coercion

Returns this type's Moose::Meta::TypeCoercion if one exists.

hand_optimized_type_constraint
has_hand_optimized_type_constraint
create_child_type

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-2009 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.