Commit | Line | Data |
cfd04b0c |
1 | package Catalyst::ActionContainer; |
2 | |
3 | use strict; |
4 | use base qw/Class::Accessor::Fast/; |
5 | |
6 | __PACKAGE__->mk_accessors(qw/part actions/); |
7 | |
8 | use overload ( |
9 | |
10 | # Stringify to path part for tree search |
11 | q{""} => sub { shift->{part} }, |
12 | |
13 | ); |
14 | |
15 | =head1 NAME |
16 | |
aa6283e4 |
17 | Catalyst::ActionContainer - Catalyst Action Container |
cfd04b0c |
18 | |
19 | =head1 SYNOPSIS |
20 | |
21 | See L<Catalyst>. |
22 | |
23 | =head1 DESCRIPTION |
24 | |
649fd1fa |
25 | This is a container for actions. The dispatcher sets up a tree of these |
26 | to represent the various dispatch points in your application. |
27 | |
cfd04b0c |
28 | =head1 METHODS |
29 | |
649fd1fa |
30 | =head2 get_action($name) |
31 | |
32 | Returns an action from this container based on the action name, or undef |
79a3189a |
33 | |
34 | =cut |
35 | |
36 | sub get_action { |
bcd1002b |
37 | my ( $self, $name ) = @_; |
79a3189a |
38 | return $self->actions->{$name} if defined $self->actions->{$name}; |
39 | return; |
40 | } |
cfd04b0c |
41 | |
b5ecfcf0 |
42 | =head2 actions |
79a3189a |
43 | |
649fd1fa |
44 | Accessor to the actions hashref, containing all actions in this container. |
45 | |
b5ecfcf0 |
46 | =head2 part |
cfd04b0c |
47 | |
649fd1fa |
48 | Accessor to the path part this container resolves to. Also what the container |
49 | stringifies to. |
50 | |
cfd04b0c |
51 | =head1 AUTHOR |
52 | |
53 | Matt S. Trout |
54 | |
55 | =head1 COPYRIGHT |
56 | |
57 | This program is free software, you can redistribute it and/or modify it under |
58 | the same terms as Perl itself. |
59 | |
60 | =cut |
61 | |
62 | 1; |