symbol lineup is mandatory
[gitmo/Mouse.git] / lib / Mouse / TypeRegistry.pm
index 4f3125c..c5ce7ed 100644 (file)
@@ -18,7 +18,7 @@ sub optimized_constraints {
         Num        => sub { !ref($_) && looks_like_number($_) },
         Int        => sub { defined($_) && !ref($_) && /^-?[0-9]+$/ },
         Str        => sub { defined($_) && !ref($_) },
-        ClassName  => sub { 1 },
+        ClassName  => sub { Mouse::is_class_loaded($_) },
         Ref        => sub { ref($_) },
 
         ScalarRef  => sub { ref($_) eq 'SCALAR' },
@@ -42,3 +42,18 @@ sub optimized_constraints {
 
 1;
 
+__END__
+
+=head1 NAME
+
+Mouse::TypeRegistry - simple type constraints
+
+=head1 METHODS
+
+=head2 optimized_constraints -> HashRef[CODE]
+
+Returns the simple type constraints that Mouse understands.
+
+=cut
+
+