Commit | Line | Data |
---|---|---|
4d33251a | 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; |