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