| 1 | package WWW::MenuGrinder::Role::Plugin; | ||
| 2 | our $VERSION = '0.01_01'; | ||
| 3 | |||
| 4 | |||
| 5 | # ABSTRACT: WWW::MenuGrinder role for all plugins. | ||
| 6 | |||
| 7 | use Moose::Role; | ||
| 8 | |||
| 9 | has 'grinder' => ( | ||
| 10 | is => 'ro', | ||
| 11 | isa => 'WWW::MenuGrinder', | ||
| 12 | required => 1, | ||
| 13 | ); | ||
| 14 | |||
| 15 | sub verify_plugin { | ||
| 16 | my ($self) = @_; | ||
| 17 | |||
| 18 | if ($self->can('plugin_required_grinder_methods')) { | ||
| 19 | my @methods = $self->plugin_required_grinder_methods; | ||
| 20 | for my $m (@methods) { | ||
| 21 | if (! $self->grinder->can($m)) { | ||
| 22 | die ref($self) . " requires method '$m' but " . ref($self->grinder) | ||
| 23 | . "doesn't provide it.\n"; | ||
| 24 | } | ||
| 25 | } | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | no Moose::Role; | ||
| 30 | |||
| 31 | 1; | ||
| 32 | |||
| 33 | __END__ | ||
| 34 | =head1 NAME | ||
| 35 | |||
| 36 | WWW::MenuGrinder::Role::Plugin - WWW::MenuGrinder role for all plugins. | ||
| 37 | |||
| 38 | =head1 VERSION | ||
| 39 | |||
| 40 | version 0.01_01 | ||
| 41 | |||
| 42 | =head1 AUTHOR | ||
| 43 | |||
| 44 | Andrew Rodland <andrew@hbslabs.com> | ||
| 45 | |||
| 46 | =head1 COPYRIGHT AND LICENSE | ||
| 47 | |||
| 48 | This software is copyright (c) 2009 by HBS Labs, LLC.. | ||
| 49 | |||
| 50 | This is free software; you can redistribute it and/or modify it under | ||
| 51 | the same terms as perl itself. | ||
| 52 |