Commit | Line | Data |
fbcc39ad |
1 | package Catalyst::Action; |
2 | |
3 | use strict; |
4 | use base qw/Class::Accessor::Fast/; |
5 | |
11bd4e3e |
6 | __PACKAGE__->mk_accessors(qw/class namespace reverse attributes name code/); |
fbcc39ad |
7 | |
8 | use overload ( |
9 | |
10 | # Stringify to reverse for debug output etc. |
11 | q{""} => sub { shift->{reverse} }, |
12 | |
13 | # Codulate to encapsulated action coderef |
14 | '&{}' => sub { shift->{code} }, |
15 | |
16 | ); |
17 | |
18 | =head1 NAME |
19 | |
20 | Catalyst::Action - Catalyst Action |
21 | |
22 | =head1 SYNOPSIS |
23 | |
24 | See L<Catalyst>. |
25 | |
26 | =head1 DESCRIPTION |
27 | |
28 | =head1 METHODS |
29 | |
30 | =over 4 |
31 | |
b96f127f |
32 | =item attributes |
33 | |
11bd4e3e |
34 | =item class |
35 | |
fbcc39ad |
36 | =item code |
37 | |
38 | =item execute |
39 | |
40 | =cut |
41 | |
42 | sub execute { # Execute ourselves against a context |
43 | my ( $self, $c ) = @_; |
d4a29ad2 |
44 | local $c->{namespace} = $self->namespace; |
11bd4e3e |
45 | return $c->execute( $self->class, $self ); |
fbcc39ad |
46 | } |
47 | |
48 | =item namespace |
49 | |
50 | =item reverse |
51 | |
6b239949 |
52 | =item name |
53 | |
fbcc39ad |
54 | =back |
55 | |
56 | =head1 AUTHOR |
57 | |
58 | Matt S. Trout |
59 | |
60 | =head1 COPYRIGHT |
61 | |
62 | This program is free software, you can redistribute it and/or modify it under |
63 | the same terms as Perl itself. |
64 | |
65 | =cut |
66 | |
67 | 1; |