| 1 | package Magpie::Dispatcher::RequestParam; | ||||||||||||||||||||||||||||
| 2 | 8 | $Magpie::Dispatcher::RequestParam::VERSION = '1.163200'; | |||||||||||||||||||||||||||
| 3 | 8 | ▶ | use MooseX::Role::Parameterized; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | # ABSTRACT: Request Parameter Dispatcher | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 8 | parameter state_param => ( | |||||||||||||||||||||||||||
| 8 | is => 'ro', | ||||||||||||||||||||||||||||
| 9 | isa => 'Str', | ||||||||||||||||||||||||||||
| 10 | default => 'appstate', | ||||||||||||||||||||||||||||
| 11 | ); | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 8 | ▶ | role { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 8 | my $p = shift; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 8 | has 'state_param' => ( | |||||||||||||||||||||||||||
| 17 | is => 'ro', | ||||||||||||||||||||||||||||
| 18 | isa => 'Str', | ||||||||||||||||||||||||||||
| 19 | default => $p->state_param, | ||||||||||||||||||||||||||||
| 20 | ); | ||||||||||||||||||||||||||||
| 21 | 8 | }; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 24 | ▶ | sub load_queue { | ||||||||||||||||||||||||||
|
Subroutine
load_queue: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 24 | 24 | my $self = shift; | |||||||||||||||||||||||||||
| 25 | 24 | my @events = (); | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 24 | ▶ | if ($self->can('init')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 18 | push @events, 'init'; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 24 | my $state = $self->request->param( $self->state_param ); | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 24 | ▶ | if ($state and $self->can($state)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$state and $self->can($state)
MC/DC50%1/2
$state and $self->can($state)
$state
$self->can($state)
Truth table66%2/3
A and B
A= $stateB= $self->can($state)
| |||||||||||||||||||||||||||||
| 34 | 21 | push @events, $state; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | else { | ||||||||||||||||||||||||||||
| 37 | 3 | ▶ | push(@events, 'default') if $self->can('default'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 24 | return @events; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 8 | 1; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | __END__ | ||||||||||||||||||||||||||||