Commit | Line | Data |
b96f127f |
1 | package Catalyst::DispatchType; |
2 | |
3c0186f2 |
3 | use Moose; |
e8b9f2a9 |
4 | #use strict; |
5 | #use base 'Class::Accessor::Fast'; |
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 | |
3c0186f2 |
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 |
3c0186f2 |
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 | |
2633d7dc |
62 | =head1 AUTHOR |
63 | |
64 | Matt S Trout |
65 | Sebastian Riedel, C<sri@cpan.org> |
66 | |
67 | =head1 COPYRIGHT |
68 | |
69 | This program is free software, you can redistribute it and/or modify it under |
70 | the same terms as Perl itself. |
71 | |
72 | =cut |
b96f127f |
73 | |
74 | 1; |