Commit | Line | Data |
fbcc39ad |
1 | package Catalyst::Action; |
2 | |
3 | use strict; |
4 | use base qw/Class::Accessor::Fast/; |
5 | |
6b239949 |
6 | __PACKAGE__->mk_accessors(qw/code namespace reverse prefix attributes name/); |
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 | |
fbcc39ad |
34 | =item code |
35 | |
36 | =item execute |
37 | |
38 | =cut |
39 | |
40 | sub execute { # Execute ourselves against a context |
41 | my ( $self, $c ) = @_; |
42 | return $c->execute( $self->namespace, $self ); |
43 | } |
44 | |
45 | =item namespace |
46 | |
47 | =item reverse |
48 | |
6b239949 |
49 | =item name |
50 | |
fbcc39ad |
51 | =item new |
52 | |
53 | =cut |
54 | |
55 | sub new { # Dumbass constructor |
56 | my ( $class, $attrs ) = @_; |
57 | return bless { %{ $attrs || {} } }, $class; |
58 | } |
59 | |
60 | =back |
61 | |
62 | =head1 AUTHOR |
63 | |
64 | Matt S. Trout |
65 | |
66 | =head1 COPYRIGHT |
67 | |
68 | This program is free software, you can redistribute it and/or modify it under |
69 | the same terms as Perl itself. |
70 | |
71 | =cut |
72 | |
73 | 1; |