| 1 | package Badger::Apps; | ||
| 2 | |||
| 3 | use Badger::Factory::Class | ||
| 4 | version => 0.01, | ||
| 5 | debug => 0, | ||
| 6 | item => 'app'; | ||
| 7 | |||
| 8 | |||
| 9 | sub found_module { | ||
| 10 | my ($self, $type, $module, $args) = @_; | ||
| 11 | $self->debug("Found module: $type => $module") if DEBUG; | ||
| 12 | $self->{ loaded }->{ $module } ||= class($module)->load; | ||
| 13 | return $module; | ||
| 14 | } | ||
| 15 | |||
| 16 | sub not_found { | ||
| 17 | my ($self, $type, @args) = @_; | ||
| 18 | return $self->decline_msg( not_found => $self->{ item }, $type ); | ||
| 19 | } | ||
| 20 | |||
| 21 | |||
| 22 | 1; | ||
| 23 | |||
| 24 | =head1 NAME | ||
| 25 | |||
| 26 | Badger::Apps - factory module for application modules | ||
| 27 | |||
| 28 | =head1 DESCRIPTION | ||
| 29 | |||
| 30 | This module implements a subclass of L<Badger::Factory> for loading and | ||
| 31 | instantiating L<Badger::App> application modules. | ||
| 32 | |||
| 33 | =head1 METHODS | ||
| 34 | |||
| 35 | The following methods are defined in addition to those inherited from the | ||
| 36 | L<Badger::Factory> and L<Badger::Base> base classes. | ||
| 37 | |||
| 38 | =head2 found_module($type, $module, @args) | ||
| 39 | |||
| 40 | =head2 not_found($type, @args) | ||
| 41 | |||
| 42 | =head1 AUTHOR | ||
| 43 | |||
| 44 | Andy Wardley L<http://wardley.org/> | ||
| 45 | |||
| 46 | =head1 COPYRIGHT | ||
| 47 | |||
| 48 | Copyright (C) 2008-2012 Andy Wardley. All Rights Reserved. | ||
| 49 | |||
| 50 | This module is free software; you can redistribute it and/or | ||
| 51 | modify it under the same terms as Perl itself. | ||
| 52 | |||
| 53 | =head1 SEE ALSO | ||
| 54 | |||
| 55 | L<Badger::Factory>, | ||
| 56 | L<Badger::Base>. | ||
| 57 | |||
| 58 | =cut | ||
| 59 | |||
| 60 | # Local Variables: | ||
| 61 | # mode: perl | ||
| 62 | # perl-indent-level: 4 | ||
| 63 | # indent-tabs-mode: nil | ||
| 64 | # End: | ||
| 65 | # | ||
| 66 | # vim: expandtab shiftwidth=4: | ||
| 67 |