X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FTypeConstraint%2FParameterized.pm;h=43078b6f200c24298317e52dc43d0dedfcf14b0f;hb=d5f6cadef8d83deaf7dd95302908cd4f61aeab8a;hp=d0cdfa9ac3f49f5a77ad2925e220d39c722db69d;hpb=f6fdcfe79e8a84a867b56c8c3b6c08d9550a167f;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/TypeConstraint/Parameterized.pm b/lib/Moose/Meta/TypeConstraint/Parameterized.pm index d0cdfa9..43078b6 100644 --- a/lib/Moose/Meta/TypeConstraint/Parameterized.pm +++ b/lib/Moose/Meta/TypeConstraint/Parameterized.pm @@ -8,10 +8,6 @@ use Scalar::Util 'blessed'; use Moose::Util::TypeConstraints; use Moose::Meta::TypeConstraint::Parameterizable; -our $VERSION = '0.72'; -$VERSION = eval $VERSION; -our $AUTHORITY = 'cpan:STEVAN'; - use base 'Moose::Meta::TypeConstraint'; __PACKAGE__->meta->add_attribute('type_parameter' => ( @@ -25,7 +21,7 @@ sub equals { my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name); return unless $other->isa(__PACKAGE__); - + return ( $self->type_parameter->equals( $other->type_parameter ) and @@ -35,14 +31,14 @@ sub equals { sub compile_type_constraint { my $self = shift; - + unless ( $self->has_type_parameter ) { require Moose; Moose->throw_error("You cannot create a Higher Order type without a type parameter"); } my $type_parameter = $self->type_parameter; - + unless ( blessed $type_parameter && $type_parameter->isa('Moose::Meta::TypeConstraint') ) { require Moose; Moose->throw_error("The type parameter must be a Moose meta type"); @@ -51,14 +47,14 @@ sub compile_type_constraint { foreach my $type (Moose::Util::TypeConstraints::get_all_parameterizable_types()) { if (my $constraint = $type->generate_constraint_for($self)) { $self->_set_constraint($constraint); - return $self->SUPER::compile_type_constraint; + return $self->SUPER::compile_type_constraint; } } - - # if we get here, then we couldn't + + # if we get here, then we couldn't # find a way to parameterize this type require Moose; - Moose->throw_error("The " . $self->name . " constraint cannot be used, because " + Moose->throw_error("The " . $self->name . " constraint cannot be used, because " . $self->parent->name . " doesn't subtype or coerce from a parameterizable type."); } @@ -69,15 +65,13 @@ sub create_child_type { 1; +# ABSTRACT: Type constraints with a bound parameter (ArrayRef[Int]) + __END__ =pod -=head1 NAME - -Moose::Meta::TypeConstraint::Parameterized - Type constraints with a bound parameter (ArrayRef[Int]) - =head1 METHODS This class is intentionally not documented because the API is @@ -90,21 +84,6 @@ L. =head1 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. - -=head1 AUTHOR - -Stevan Little Estevan@iinteractive.comE - -=head1 COPYRIGHT AND LICENSE - -Copyright 2006-2009 by Infinity Interactive, Inc. - -L - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. +See L for details on reporting bugs. =cut