Checking in changes prior to tagging of version 0.50_02. Changelog diff is:
[gitmo/Mouse.git] / lib / Mouse / Meta / TypeConstraint.pm
index f6bdac8..6be61f6 100644 (file)
@@ -67,6 +67,10 @@ sub name;
 sub parent;
 sub message;
 sub has_coercion;
+
+sub type_parameter;
+sub __is_parameterized;
+
 sub _compiled_type_constraint;
 sub _compiled_type_coercion;
 
@@ -220,6 +224,15 @@ sub parameterize{
     );
 }
 
+sub assert_valid {
+    my ($self, $value) = @_;
+
+    if(!$self->_compiled_type_constraint->($value)){
+        Carp::confess($self->get_message($value));
+    }
+    return 1;
+}
+
 1;
 __END__
 
@@ -229,7 +242,7 @@ Mouse::Meta::TypeConstraint - The Mouse Type Constraint metaclass
 
 =head1 VERSION
 
-This document describes Mouse version 0.50_01
+This document describes Mouse version 0.50_02
 
 =head1 DESCRIPTION