summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2009-07-01 08:24:12 +0200
committerfranck cuny <franck@lumberjaph.net>2009-07-01 08:24:12 +0200
commitd9300f79bff6a04da2dafd1e786f6e35f40901f1 (patch)
treec31715b82f03c8ec0df646125ec4ed917972d43a
parentadd original idea (diff)
downloadmoosex-methodprivate-d9300f79bff6a04da2dafd1e786f6e35f40901f1.tar.gz
replace the check with superclasses with isa
-rw-r--r--lib/MooseX/MethodPrivate.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/MooseX/MethodPrivate.pm b/lib/MooseX/MethodPrivate.pm
index 639e155..f82c26a 100644
--- a/lib/MooseX/MethodPrivate.pm
+++ b/lib/MooseX/MethodPrivate.pm
@@ -31,10 +31,9 @@ sub protected {
 
     my $body = sub {
         my $new_caller = caller();
-        my @isa        = $new_caller->meta->superclasses;
-        my @check      = grep {/$caller/} @isa;
         croak "The $caller\::$name method is protected"
-            unless ( ( scalar caller() ) eq $caller || @check );
+            unless ( ( scalar caller() ) eq $caller
+            || $new_caller->isa($caller) );
 
         goto &{$real_body};
     };