| 1 | package Badger::Apps; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | use Badger::Factory::Class | ||||||||||||||||||||
| 4 | 1 | version => 0.01, | |||||||||||||||||||
| 5 | debug => 0, | ||||||||||||||||||||
| 6 | 1 | ▶ | item => 'app'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | sub found_module { | ||||||||||||||||||||
| 10 | 0 | ▶ | my ($self, $type, $module, $args) = @_; | ||||||||||||||||||
|
Subroutine
found_module: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 11 | 0 | $self->debug("Found module: $type => $module") if DEBUG; | |||||||||||||||||||
| 12 | 0 | ▶ | $self->{ loaded }->{ $module } ||= class($module)->load; | ||||||||||||||||||
|
Condition0%0/3
$self->{"loaded"}{$module} ||= Badger::Apps::class($module)->load
MC/DC0%0/2
$self->{"loaded"}{$module} ||= Badger::Apps::class($module)->load
$self->{"loaded"}{$module}
Badger::Apps::class($module)->load
Truth table0%0/3
A ||= B
A= $self->{"loaded"}{$module}B= Badger::Apps::class($module)->load
| |||||||||||||||||||||
| 13 | 0 | return $module; | |||||||||||||||||||
| 14 | } | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | sub not_found { | ||||||||||||||||||||
| 17 | 0 | ▶ | my ($self, $type, @args) = @_; | ||||||||||||||||||
|
Subroutine
not_found: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 18 | 0 | return $self->decline_msg( not_found => $self->{ item }, $type ); | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 1 | 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 | |||||||||||||||||||||