- Fixes for rt.cpan #17322 and #17331
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Action.pm
CommitLineData
fbcc39ad 1package Catalyst::Action;
2
3use strict;
4use base qw/Class::Accessor::Fast/;
5
11bd4e3e 6__PACKAGE__->mk_accessors(qw/class namespace reverse attributes name code/);
fbcc39ad 7
8use 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
6a064886 16 # Make general $stuff still work
17 fallback => 1,
18
fbcc39ad 19);
20
21=head1 NAME
22
23Catalyst::Action - Catalyst Action
24
25=head1 SYNOPSIS
26
27See L<Catalyst>.
28
29=head1 DESCRIPTION
30
31=head1 METHODS
32
b5ecfcf0 33=head2 attributes
fbcc39ad 34
b5ecfcf0 35=head2 class
b96f127f 36
b5ecfcf0 37=head2 code
11bd4e3e 38
b5ecfcf0 39=head2 execute
fbcc39ad 40
41=cut
42
43sub execute { # Execute ourselves against a context
44 my ( $self, $c ) = @_;
261c571e 45 local $c->namespace = $self->namespace;
11bd4e3e 46 return $c->execute( $self->class, $self );
fbcc39ad 47}
48
b5ecfcf0 49=head2 namespace
fbcc39ad 50
b5ecfcf0 51=head2 reverse
6b239949 52
b5ecfcf0 53=head2 name
fbcc39ad 54
55=head1 AUTHOR
56
57Matt S. Trout
58
59=head1 COPYRIGHT
60
61This program is free software, you can redistribute it and/or modify it under
62the same terms as Perl itself.
63
64=cut
65
661;