add use strict; use warnings to modules, just to be sure
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Meta / Plugin.pm
1 use strict;
2 use warnings;
3 package Devel::REPL::Meta::Plugin;
4
5 use Moose;
6
7 extends 'Moose::Meta::Role';
8
9 before 'apply' => sub {
10   my ($self, $other) = @_;
11   return unless $other->isa('Devel::REPL');
12   if (my $pre = $self->get_method('BEFORE_PLUGIN')) {
13     $pre->body->($other, $self);
14   }
15 };
16
17 after 'apply' => sub {
18   my ($self, $other) = @_;
19   return unless $other->isa('Devel::REPL');
20   if (my $pre = $self->get_method('AFTER_PLUGIN')) {
21     $pre->body->($other, $self);
22   }
23 };
24
25 1;