Improved performance a bit by not running prepare_query_parameters unless we actually...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Action.pm
CommitLineData
fbcc39ad 1package Catalyst::Action;
2
3use strict;
4use base qw/Class::Accessor::Fast/;
5
cfd04b0c 6__PACKAGE__->mk_accessors(qw/code namespace reverse prefix/);
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
16);
17
18=head1 NAME
19
20Catalyst::Action - Catalyst Action
21
22=head1 SYNOPSIS
23
24See L<Catalyst>.
25
26=head1 DESCRIPTION
27
28=head1 METHODS
29
30=over 4
31
32=item code
33
34=item execute
35
36=cut
37
38sub execute { # Execute ourselves against a context
39 my ( $self, $c ) = @_;
40 return $c->execute( $self->namespace, $self );
41}
42
43=item namespace
44
45=item reverse
46
47=item new
48
49=cut
50
51sub new { # Dumbass constructor
52 my ( $class, $attrs ) = @_;
53 return bless { %{ $attrs || {} } }, $class;
54}
55
56=back
57
58=head1 AUTHOR
59
60Matt S. Trout
61
62=head1 COPYRIGHT
63
64This program is free software, you can redistribute it and/or modify it under
65the same terms as Perl itself.
66
67=cut
68
691;