Split symbol name instead of munging it in-place
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Meta / Plugin.pm
1 package Devel::REPL::Meta::Plugin;
2
3 use Moose;
4
5 extends 'Moose::Meta::Role';
6
7 before 'apply' => sub {
8   my ($self, $other) = @_;
9   return unless $other->isa('Devel::REPL');
10   if (my $pre = $self->get_method('BEFORE_PLUGIN')) {
11     $pre->body->($other, $self);
12   }
13 };
14
15 after 'apply' => sub {
16   my ($self, $other) = @_;
17   return unless $other->isa('Devel::REPL');
18   if (my $pre = $self->get_method('AFTER_PLUGIN')) {
19     $pre->body->($other, $self);
20   }
21 };
22
23 1;