| 1 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 2 | # GX Framework (c) 2009-2011 Jörg A. Uzarek <uzarek@runlevelnull.de> | ||||||||||
| 3 | # File: GX/Dispatcher.pm | ||||||||||
| 4 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 5 | |||||||||||
| 6 | package GX::Dispatcher; | ||||||||||
| 7 | |||||||||||
| 8 | |||||||||||
| 9 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 10 | # Class setup | ||||||||||
| 11 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | use GX::Class ( extends => 'GX::Component::Singleton' ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | build; | |||||||||
| 16 | |||||||||||
| 17 | |||||||||||
| 18 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 19 | # Export mechanism | ||||||||||
| 20 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 21 | |||||||||||
| 22 | 1 | __PACKAGE__->_install_import_method; | |||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 26 | # Handlers | ||||||||||
| 27 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub dispatch :Handler( DispatchActions ) { | ||||||||
|
Subroutine
dispatch: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 30 | |||||||||||
| 31 | 0 | my $self = shift; | |||||||||
| 32 | 0 | my $context = shift; | |||||||||
| 33 | |||||||||||
| 34 | 0 | ▶ | if ( my $action_queue = $context->action_queue ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | while ( my $action = $action_queue->next ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 0 | $action->dispatch( $context ); | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 0 | $context->action_queue( undef ); | |||||||||
| 41 | |||||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 0 | return; | |||||||||
| 45 | |||||||||||
| 46 | 1 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 47 | |||||||||||
| 48 | |||||||||||
| 49 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 50 | # Private Methods | ||||||||||
| 51 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 52 | |||||||||||
| 53 | 0 | ▶ | sub _validate_class_name { | ||||||||
|
Subroutine
_validate_class_name: not called CC=1 SCAR=6.9
| |||||||||||
| 54 | |||||||||||
| 55 | 0 | return $_[1] =~ /^(?:[_a-zA-Z]\w*::)+?Dispatcher$/; | |||||||||
| 56 | |||||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | |||||||||||
| 60 | 1 | 1; | |||||||||
| 61 | |||||||||||
| 62 | __END__ | ||||||||||