Updated Catalyst::Request and Catalyst::Response to have sensible defaults for attributes
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType.pm
1 package Catalyst::DispatchType;
2
3 use Moose;
4 #use strict;
5 #use base 'Class::Accessor::Fast';
6
7 =head1 NAME
8
9 Catalyst::DispatchType - DispatchType Base Class
10
11 =head1 SYNOPSIS
12
13 See L<Catalyst>.
14
15 =head1 DESCRIPTION
16
17 This is an abstract base class for Dispatch Types. 
18
19 =head1 METHODS
20
21 =head2 $self->list($c)
22
23 abstract method, to be implemented by dispatchtypes. Called to display
24 info in debug log.
25
26 =cut
27
28 sub list { }
29
30 =head2 $self->match( $c, $path )
31
32 abstract method, to be implemented by dispatchtypes. Returns true if the
33 dispatch type matches the given path
34
35 =cut
36
37 sub match { die "Abstract method!" }
38
39 =head2 $self->register( $c, $action )
40
41 abstract method, to be implemented by dispatchtypes. Takes a
42 context object and a L<Catalyst::Action> object. 
43
44 Should return true if it registers something, or false otherwise.
45
46 =cut
47
48 sub register { }
49
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
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
73
74 no Moose;
75 __PACKAGE__->meta->make_immutable;
76
77 1;