Reformatted documentation
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Action.pm
1 package Catalyst::Action;
2
3 use strict;
4 use base qw/Class::Accessor::Fast/;
5
6 __PACKAGE__->mk_accessors(qw/class namespace reverse attributes name code/);
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 =head2 attributes
31
32 =head2 class
33
34 =head2 code
35
36 =head2 execute
37
38 =cut
39
40 sub execute {    # Execute ourselves against a context
41     my ( $self, $c ) = @_;
42     local $c->namespace = $self->namespace;
43     return $c->execute( $self->class, $self );
44 }
45
46 =head2 namespace
47
48 =head2 reverse
49
50 =head2 name
51
52 =head1 AUTHOR
53
54 Matt S. Trout
55
56 =head1 COPYRIGHT
57
58 This program is free software, you can redistribute it and/or modify it under
59 the same terms as Perl itself.
60
61 =cut
62
63 1;