Allow per-case overriding of default filter
Yuval Kogman [Sun, 30 Apr 2006 18:28:07 +0000 (18:28 +0000)]
lib/Moose/Meta/Class.pm

index 7858736..70ea64a 100644 (file)
@@ -103,10 +103,12 @@ sub filter_delegations {
     grep {
         my $new_name = $_->{new_name} || $_->{name};
         no warnings "uninitialized";
-        !$self->name->can( $new_name ) and
-        $attr->accessor ne $new_name and
-        $attr->reader ne $new_name and
-        $attr->writer ne $new_name
+        $_->{no_filter} or (
+            !$self->name->can( $new_name ) and
+            $attr->accessor ne $new_name and
+            $attr->reader ne $new_name and
+            $attr->writer ne $new_name
+        );
     } @delegations;
 }