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