use Moose::Util::TypeConstraints ();
-our $VERSION = '0.94';
+our $VERSION = '1.19';
$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()