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