use Moose::Util::TypeConstraints ();
-our $VERSION = '0.86';
+our $VERSION = '1.12';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
$args{parent} = Moose::Util::TypeConstraints::find_type_constraint('Str');
+ if ( scalar @{ $args{values} } < 2 ) {
+ require Moose;
+ Moose->throw_error("You must have at least two values to enumerate through");
+ }
+
+ for (@{ $args{values} }) {
+ if (!defined($_)) {
+ require Moose;
+ Moose->throw_error("Enum values must be strings, not undef");
+ }
+ elsif (ref($_)) {
+ require Moose;
+ Moose->throw_error("Enum values must be strings, not '$_'");
+ }
+ }
+
my $self = $class->_new(\%args);
$self->compile_type_constraint()
=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.
+See L<Moose/BUGS> for details on reporting bugs.
=head1 AUTHOR
=head1 COPYRIGHT AND LICENSE
-Copyright 2006-2009 by Infinity Interactive, Inc.
+Copyright 2006-2010 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>