properly supporting a where clause in the suger example and proof you can customize...
[gitmo/MooseX-Dependent.git] / lib / MooseX / Meta / TypeConstraint / Dependent.pm
index 83d140c..ae6ca56 100644 (file)
@@ -237,6 +237,20 @@ around 'create_child_type' => sub {
     );
 };
 
+=head2 constraint
+
+We modify constraint so that the value pass is automatically dereferenced
+
+=cut
+
+around 'constraint' => sub {
+    my ($constraint, $self) = @_;
+    return sub {
+        my ($arg) = @_;
+        $self->$constraint->($arg);
+    };
+};
+
 =head2 is_a_type_of
 
 =head2 is_subtype_of