diff options
| author | franck cuny <franck@lumberjaph.net> | 2009-07-01 08:24:12 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2009-07-01 08:24:12 +0200 |
| commit | d9300f79bff6a04da2dafd1e786f6e35f40901f1 (patch) | |
| tree | c31715b82f03c8ec0df646125ec4ed917972d43a | |
| parent | add original idea (diff) | |
| download | moosex-methodprivate-d9300f79bff6a04da2dafd1e786f6e35f40901f1.tar.gz | |
replace the check with superclasses with isa
| -rw-r--r-- | lib/MooseX/MethodPrivate.pm | 5 |
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}; }; |
