Create branch register_actions.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType.pm
CommitLineData
b96f127f 1package Catalyst::DispatchType;
2
ae29b412 3use Moose;
4with 'MooseX::Emulate::Class::Accessor::Fast';
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
a486ab55 17This is an abstract base class for Dispatch Types.
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
42context object and a L<Catalyst::Action> object.
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
ae29b412 62=head2 $self->expand_action
63
64Default fallback, returns nothing. See L<Catalyst::Dispatcher> for more info
65about expand_action.
66
67=cut
68
69sub expand_action { }
70
0bf7ab71 71=head1 AUTHORS
2633d7dc 72
0bf7ab71 73Catalyst Contributors, see Catalyst.pm
2633d7dc 74
75=head1 COPYRIGHT
76
77This program is free software, you can redistribute it and/or modify it under
78the same terms as Perl itself.
79
80=cut
b96f127f 81
ae29b412 82__PACKAGE__->meta->make_immutable;
83
b96f127f 841;