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