The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MooseX::Meta::TypeConstraint::Parameterizable - Parameterizable Meta Class.

DESCRIPTION

See MooseX::Types::Parameterizable for how to use parameterizable types. This class is a subclass of Moose::Meta::TypeConstraint which provides the gut functionality to enable parameterizable type constraints.

You probably won't need to subclass or consume this class directly.

ATTRIBUTES

This class defines the following attributes.

parent_type_constraint

The type constraint whose validity is being made parameterizable.

constraining_value_type_constraint

This is a type constraint which defines what kind of value is allowed to be the constraining value of the parameterizable type.

constraining_value

This is the actual value that constraints the "parent_type_constraint"

METHODS

This class defines the following methods.

new

Do some post build stuff, mostly make sure we set the correct coercion object.

parameterize (@args)

Given a ref of type constraints, create a parameterized constraint

_generate_subtype_name

Returns a name for the parameterizable type that should be unique

create_child_type

modifier to make sure we get the constraint_generator

equals ($type_constraint)

Override the base class behavior so that a parameterizable type equal both the parent type and the overall parameterizable container. This behavior may change if we can figure out what a parameterizable type is (multiply inheritance or a role...)

is_subtype_of

Method modifier to make sure we match on subtype for both the parameterizable type as well as the type being made parameterizable

check

As with 'is_subtype_of', we need to dual dispatch the method request

validate

As with 'is_subtype_of', we need to dual dispatch the method request

_compiled_type_constraint

modify this method so that we pass along the constraining value to the constraint coderef and also throw the correct error message if the constraining value does not match it's requirement.

coerce

More method modification to support dispatch coerce to a parent.

SEE ALSO

The following modules or resources may be of interest.

Moose, Moose::Meta::TypeConstraint

AUTHOR

John Napiorkowski, <jjnapiork@cpan.org>

COPYRIGHT & LICENSE

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