| 1 | package WWW::MenuGrinder::Plugin::NullLoader; | ||
| 2 | our $VERSION = '0.01_01'; | ||
| 3 | |||
| 4 | |||
| 5 | # ABSTRACT: WWW::MenuGrinder Plugin that loads from the config. | ||
| 6 | |||
| 7 | use Moose; | ||
| 8 | |||
| 9 | with 'WWW::MenuGrinder::Role::Loader'; | ||
| 10 | |||
| 11 | sub load { | ||
| 12 | my ($self) = @_; | ||
| 13 | |||
| 14 | if (! defined $self->grinder->config->{menu}) { | ||
| 15 | die "config->{menu} is required"; | ||
| 16 | } else { | ||
| 17 | return $self->grinder->config->{menu} | ||
| 18 | } | ||
| 19 | } | ||
| 20 | |||
| 21 | no Moose; | ||
| 22 | 1; | ||
| 23 | |||
| 24 | |||
| 25 | __END__ | ||
| 26 | =head1 NAME | ||
| 27 | |||
| 28 | WWW::MenuGrinder::Plugin::NullLoader - WWW::MenuGrinder Plugin that loads from the config. | ||
| 29 | |||
| 30 | =head1 VERSION | ||
| 31 | |||
| 32 | version 0.01_01 | ||
| 33 | |||
| 34 | =head1 DESCRIPTION | ||
| 35 | |||
| 36 | C<WWW::MenuGrinder::Plugin::NullLoader> is a plugin for C<WWW::MenuGrinder>. You | ||
| 37 | should not use it directly, but include it in the C<plugins> section of a | ||
| 38 | C<WWW::MenuGrinder> config. | ||
| 39 | |||
| 40 | This is a "loader" plugin that returns a menu structure supplied in the | ||
| 41 | MenuGrinder config, rather than loading it from any external source. Its primary | ||
| 42 | use is testing, but it may be useful in self-contained scripts as well. | ||
| 43 | |||
| 44 | =head2 Configuration | ||
| 45 | |||
| 46 | The global configuration key C<menu> is expected to contain the menu structure. | ||
| 47 | |||
| 48 | =head1 AUTHOR | ||
| 49 | |||
| 50 | Andrew Rodland <andrew@hbslabs.com> | ||
| 51 | |||
| 52 | =head1 COPYRIGHT AND LICENSE | ||
| 53 | |||
| 54 | This software is copyright (c) 2009 by HBS Labs, LLC.. | ||
| 55 | |||
| 56 | This is free software; you can redistribute it and/or modify it under | ||
| 57 | the same terms as perl itself. | ||
| 58 |