MooseX::Meta::TypeConstraint::Parameterizable - Parameterizable Meta Class.
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.
This class defines the following attributes.
The type constraint whose validity is being made parameterizable.
This is a type constraint which defines what kind of value is allowed to be the constraining value of the parameterizable type.
This is the actual value that constraints the "parent_type_constraint"
This class defines the following methods.
Do some post build stuff, mostly make sure we set the correct coercion object.
Given a ref of type constraints, create a parameterized constraint
Returns a name for the parameterizable type that should be unique
modifier to make sure we get the constraint_generator
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...)
Method modifier to make sure we match on subtype for both the parameterizable type as well as the type being made parameterizable
As with 'is_subtype_of', we need to dual dispatch the method request
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.
More method modification to support dispatch coerce to a parent.
The following modules or resources may be of interest.
Moose, Moose::Meta::TypeConstraint
John Napiorkowski, <jjnapiork@cpan.org>
<jjnapiork@cpan.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install MooseX::Types::Parameterizable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Types::Parameterizable
CPAN shell
perl -MCPAN -e shell install MooseX::Types::Parameterizable
For more information on module installation, please visit the detailed CPAN module installation guide.