use warnings;
use metaclass;
-our $VERSION = '0.57';
+our $VERSION = '0.59';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
use base 'Moose::Meta::TypeConstraint';
-use Moose::Meta::TypeConstraint::Parameterized;
-use Moose::Util::TypeConstraints ();
__PACKAGE__->meta->add_attribute('constraint_generator' => (
accessor => 'constraint_generator',
};
}
-sub parse_type_parameter {
- my ($self, $type_parameter) = @_;
- return Moose::Util::TypeConstraints::find_or_create_isa_type_constraint($type_parameter);
-}
-
-sub parameterize {
- my ( $self, $contained_tc ) = @_;
-
- if ( $contained_tc->isa('Moose::Meta::TypeConstraint') ) {
- my $tc_name = $self->name . '[' . $contained_tc->name . ']';
- return Moose::Meta::TypeConstraint::Parameterized->new(
- name => $tc_name,
- parent => $self,
- type_parameter => $contained_tc,
- );
- }
- else {
- Moose->throw_error("The type parameter must be a Moose meta type");
- }
-}
-
1;
=item B<generate_constraint_for>
-=item B<parse_type_parameter>
-
-Given a string, convert it to a Perl structure.
-
-=item B<parameterize>
-
-Given an array of type constraints, parameterize the current type constraint.
-
=item B<meta>
=back