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