tighten this lib import
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Meta / Plugin.pm
CommitLineData
1716b200 1use strict;
2use warnings;
4d33251a 3package Devel::REPL::Meta::Plugin;
4
5use Moose;
1d6c2dbc 6use namespace::autoclean;
4d33251a 7
8extends 'Moose::Meta::Role';
9
10before 'apply' => sub {
11 my ($self, $other) = @_;
036068ec 12 return unless $other->isa('Devel::REPL');
4d33251a 13 if (my $pre = $self->get_method('BEFORE_PLUGIN')) {
14 $pre->body->($other, $self);
15 }
16};
17
18after 'apply' => sub {
19 my ($self, $other) = @_;
036068ec 20 return unless $other->isa('Devel::REPL');
4d33251a 21 if (my $pre = $self->get_method('AFTER_PLUGIN')) {
22 $pre->body->($other, $self);
23 }
24};
25
261;