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