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