Commit | Line | Data |
b96f127f |
1 | package Catalyst::DispatchType; |
2 | |
0fc2d522 |
3 | use Moose; # using it to add Moose::Object to @ISA ... |
4 | no Moose; |
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 | |
ac5c933b |
16 | This is an abstract base class for Dispatch Types. |
a486ab55 |
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 |
ac5c933b |
41 | context object and a L<Catalyst::Action> object. |
4ab87e27 |
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 | |
ae0e35ee |
61 | =head2 $self->expand_action |
62 | |
63 | Default fallback, returns nothing. See L<Catalyst::Dispatcher> for more info |
64 | about expand_action. |
65 | |
66 | =cut |
67 | |
52f71256 |
68 | sub expand_action { } |
69 | |
2f381252 |
70 | =head1 AUTHORS |
2633d7dc |
71 | |
2f381252 |
72 | Catalyst Contributors, see Catalyst.pm |
2633d7dc |
73 | |
74 | =head1 COPYRIGHT |
75 | |
76 | This program is free software, you can redistribute it and/or modify it under |
77 | the same terms as Perl itself. |
78 | |
79 | =cut |
b96f127f |
80 | |
e5ecd5bc |
81 | __PACKAGE__->meta->make_immutable; |
82 | |
b96f127f |
83 | 1; |