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