documention for cpan release
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType.pm
CommitLineData
b96f127f 1package Catalyst::DispatchType;
2
531f1ab6 3use Moose;
4with 'MooseX::Emulate::Class::Accessor::Fast';
0fc2d522 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
26dc649a 17This is an abstract base class for Dispatch Types.
18
19From a code perspective, dispatch types are used to find which actions
20to call for a given request URL. Website authors will typically work
21with them via subroutine names attributes; a description of dispatch
22at the attribute/URL level is given in L<Catalyst::Manual::Intro>.
a486ab55 23
2633d7dc 24=head1 METHODS
25
b5ecfcf0 26=head2 $self->list($c)
a9cbd748 27
4ab87e27 28abstract method, to be implemented by dispatchtypes. Called to display
29info in debug log.
30
a9cbd748 31=cut
32
33sub list { }
34
b5ecfcf0 35=head2 $self->match( $c, $path )
2633d7dc 36
4ab87e27 37abstract method, to be implemented by dispatchtypes. Returns true if the
38dispatch type matches the given path
39
2633d7dc 40=cut
41
42sub match { die "Abstract method!" }
43
b5ecfcf0 44=head2 $self->register( $c, $action )
2633d7dc 45
4ab87e27 46abstract method, to be implemented by dispatchtypes. Takes a
b0ad47c1 47context object and a L<Catalyst::Action> object.
4ab87e27 48
49Should return true if it registers something, or false otherwise.
50
2633d7dc 51=cut
52
a9cbd748 53sub register { }
2633d7dc 54
ea0e58d9 55=head2 $self->uri_for_action( $action, \@captures )
56
57abstract method, to be implemented by dispatchtypes. Takes a
58L<Catalyst::Action> object and an arrayref of captures, and should
59return either a URI part which if placed in $c->req->path would cause
60$self->match to match this action and set $c->req->captures to the supplied
61arrayref, or undef if unable to do so.
62
63=cut
64
65sub uri_for_action { }
66
ae0e35ee 67=head2 $self->expand_action
68
69Default fallback, returns nothing. See L<Catalyst::Dispatcher> for more info
70about expand_action.
71
72=cut
73
52f71256 74sub expand_action { }
75
c4586fd0 76sub _is_low_precedence { 0 }
77
2f381252 78=head1 AUTHORS
2633d7dc 79
2f381252 80Catalyst Contributors, see Catalyst.pm
2633d7dc 81
82=head1 COPYRIGHT
83
536bee89 84This library is free software. You can redistribute it and/or modify it under
2633d7dc 85the same terms as Perl itself.
86
87=cut
b96f127f 88
e5ecd5bc 89__PACKAGE__->meta->make_immutable;
90
b96f127f 911;