| 1 | package Catalyst::DispatchType; | ||
| 2 | |||
| 3 | 154 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 154 | with 'MooseX::Emulate::Class::Accessor::Fast'; | |
| 5 | 154 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Catalyst::DispatchType - DispatchType Base Class | ||
| 10 | |||
| 11 | =head1 SYNOPSIS | ||
| 12 | |||
| 13 | See L<Catalyst>. | ||
| 14 | |||
| 15 | =head1 DESCRIPTION | ||
| 16 | |||
| 17 | This is an abstract base class for Dispatch Types. | ||
| 18 | |||
| 19 | From a code perspective, dispatch types are used to find which actions | ||
| 20 | to call for a given request URL. Website authors will typically work | ||
| 21 | with them via subroutine names attributes; a description of dispatch | ||
| 22 | at the attribute/URL level is given in L<Catalyst::Manual::Intro>. | ||
| 23 | |||
| 24 | =head1 METHODS | ||
| 25 | |||
| 26 | =head2 $self->list($c) | ||
| 27 | |||
| 28 | abstract method, to be implemented by dispatchtypes. Called to display | ||
| 29 | info in debug log. | ||
| 30 | |||
| 31 | =cut | ||
| 32 | |||
| 33 | 14 | ▶ | sub list { } |
|
Subroutine
list: called CC=1 SCAR=0.0
Pod
documented
| |||
| 34 | |||
| 35 | =head2 $self->match( $c, $path ) | ||
| 36 | |||
| 37 | abstract method, to be implemented by dispatchtypes. Returns true if the | ||
| 38 | dispatch type matches the given path | ||
| 39 | |||
| 40 | =cut | ||
| 41 | |||
| 42 | 0 | ▶ | sub match { die "Abstract method!" } |
|
Subroutine
match: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 43 | |||
| 44 | =head2 $self->register( $c, $action ) | ||
| 45 | |||
| 46 | abstract method, to be implemented by dispatchtypes. Takes a | ||
| 47 | context object and a L<Catalyst::Action> object. | ||
| 48 | |||
| 49 | Should return true if it registers something, or false otherwise. | ||
| 50 | |||
| 51 | =cut | ||
| 52 | |||
| 53 | 8 | ▶ | sub register { } |
|
Subroutine
register: called CC=1 SCAR=0.0
Pod
documented
| |||
| 54 | |||
| 55 | =head2 $self->uri_for_action( $action, \@captures ) | ||
| 56 | |||
| 57 | abstract method, to be implemented by dispatchtypes. Takes a | ||
| 58 | L<Catalyst::Action> object and an arrayref of captures, and should | ||
| 59 | return either a URI part which if placed in $c->req->path would cause | ||
| 60 | $self->match to match this action and set $c->req->captures to the supplied | ||
| 61 | arrayref, or undef if unable to do so. | ||
| 62 | |||
| 63 | =cut | ||
| 64 | |||
| 65 | 8 | ▶ | sub uri_for_action { } |
|
Subroutine
uri_for_action: called CC=1 SCAR=0.0
Pod
documented
| |||
| 66 | |||
| 67 | =head2 $self->expand_action | ||
| 68 | |||
| 69 | Default fallback, returns nothing. See L<Catalyst::Dispatcher> for more info | ||
| 70 | about expand_action. | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | 612 | ▶ | sub expand_action { } |
|
Subroutine
expand_action: called CC=1 SCAR=0.0
Pod
documented
| |||
| 75 | |||
| 76 | 188791 | ▶ | sub _is_low_precedence { 0 } |
|
Subroutine
_is_low_precedence: called CC=1 SCAR=0.0
| |||
| 77 | |||
| 78 | =head1 AUTHORS | ||
| 79 | |||
| 80 | Catalyst Contributors, see Catalyst.pm | ||
| 81 | |||
| 82 | =head1 COPYRIGHT | ||
| 83 | |||
| 84 | This library is free software. You can redistribute it and/or modify it under | ||
| 85 | the same terms as Perl itself. | ||
| 86 | |||
| 87 | =cut | ||
| 88 | |||
| 89 | 154 | __PACKAGE__->meta->make_immutable; | |
| 90 | |||
| 91 | 154 | 1; | |