MooseX::Meta::TypeConstraint::Parameterizable - Metaclass for Parameterizable type constraints.
see MooseX::Parameterizable::Types 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.
This class is not intended for public consumption. Please don't subclass it or rely on it. Chances are high stuff here is going to change a lot. For example, I will probably refactor this into several classes to get rid of all the ugly conditionals.
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
Given a ref of type constraints, create a structured type.
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.
Give you a better peek into what's causing the error.
around 'get_message' => sub { my ($get_message, $self, $value) = @_; return $self->$get_message($value); };
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.