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