c9cca5fcb9b0f2eb79844a2d0d1b1993f5d77ab0
[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   if (my $pre = $self->get_method('BEFORE_PLUGIN')) {
10     $pre->body->($other, $self);
11   }
12 };
13
14 after 'apply' => sub {
15   my ($self, $other) = @_;
16   if (my $pre = $self->get_method('AFTER_PLUGIN')) {
17     $pre->body->($other, $self);
18   }
19 };
20
21 1;