Commit | Line | Data |
b96f127f |
1 | package Catalyst::DispatchType; |
2 | |
3c0186f2 |
3 | use Moose; |
b96f127f |
4 | |
2633d7dc |
5 | =head1 NAME |
b96f127f |
6 | |
2633d7dc |
7 | Catalyst::DispatchType - DispatchType Base Class |
b96f127f |
8 | |
2633d7dc |
9 | =head1 SYNOPSIS |
10 | |
11 | See L<Catalyst>. |
12 | |
13 | =head1 DESCRIPTION |
14 | |
3c0186f2 |
15 | This is an abstract base class for Dispatch Types. |
a486ab55 |
16 | |
2633d7dc |
17 | =head1 METHODS |
18 | |
b5ecfcf0 |
19 | =head2 $self->list($c) |
a9cbd748 |
20 | |
4ab87e27 |
21 | abstract method, to be implemented by dispatchtypes. Called to display |
22 | info in debug log. |
23 | |
a9cbd748 |
24 | =cut |
25 | |
26 | sub list { } |
27 | |
b5ecfcf0 |
28 | =head2 $self->match( $c, $path ) |
2633d7dc |
29 | |
4ab87e27 |
30 | abstract method, to be implemented by dispatchtypes. Returns true if the |
31 | dispatch type matches the given path |
32 | |
2633d7dc |
33 | =cut |
34 | |
35 | sub match { die "Abstract method!" } |
36 | |
b5ecfcf0 |
37 | =head2 $self->register( $c, $action ) |
2633d7dc |
38 | |
4ab87e27 |
39 | abstract method, to be implemented by dispatchtypes. Takes a |
3c0186f2 |
40 | context object and a L<Catalyst::Action> object. |
4ab87e27 |
41 | |
42 | Should return true if it registers something, or false otherwise. |
43 | |
2633d7dc |
44 | =cut |
45 | |
a9cbd748 |
46 | sub register { } |
2633d7dc |
47 | |
ea0e58d9 |
48 | =head2 $self->uri_for_action( $action, \@captures ) |
49 | |
50 | abstract method, to be implemented by dispatchtypes. Takes a |
51 | L<Catalyst::Action> object and an arrayref of captures, and should |
52 | return either a URI part which if placed in $c->req->path would cause |
53 | $self->match to match this action and set $c->req->captures to the supplied |
54 | arrayref, or undef if unable to do so. |
55 | |
56 | =cut |
57 | |
58 | sub uri_for_action { } |
59 | |
2633d7dc |
60 | =head1 AUTHOR |
61 | |
62 | Matt S Trout |
63 | Sebastian Riedel, C<sri@cpan.org> |
64 | |
65 | =head1 COPYRIGHT |
66 | |
67 | This program is free software, you can redistribute it and/or modify it under |
68 | the same terms as Perl itself. |
69 | |
70 | =cut |
b96f127f |
71 | |
72 | 1; |