ce16150eb5577a6d5f10de5146748ec9551ce849
[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 This is an abstract base class for Dispatch Types. 
17
18 =head1 METHODS
19
20 =head2 $self->list($c)
21
22 abstract method, to be implemented by dispatchtypes. Called to display
23 info in debug log.
24
25 =cut
26
27 sub list { }
28
29 =head2 $self->match( $c, $path )
30
31 abstract method, to be implemented by dispatchtypes. Returns true if the
32 dispatch type matches the given path
33
34 =cut
35
36 sub match { die "Abstract method!" }
37
38 =head2 $self->register( $c, $action )
39
40 abstract method, to be implemented by dispatchtypes. Takes a
41 context object and a L<Catalyst::Action> object. 
42
43 Should return true if it registers something, or false otherwise.
44
45 =cut
46
47 sub register { }
48
49 =head2 $self->expand_action
50
51 Default fallback, returns nothing. See L<Catalyst::Dispatcher> for more info
52 about expand_action.
53
54 =cut
55
56 sub expand_action { }
57
58 =head2 $self->uri_for_action( $action, \@captures )
59
60 abstract method, to be implemented by dispatchtypes. Takes a
61 L<Catalyst::Action> object and an arrayref of captures, and should
62 return either a URI part which if placed in $c->req->path would cause
63 $self->match to match this action and set $c->req->captures to the supplied
64 arrayref, or undef if unable to do so.
65
66 =cut
67
68 sub uri_for_action { }
69
70 =head1 AUTHORS
71
72 Catalyst Contributors, see Catalyst.pm
73
74 =head1 COPYRIGHT
75
76 This program is free software, you can redistribute it and/or modify it under
77 the same terms as Perl itself.
78
79 =cut
80
81 1;