- Start of DispatchType refactor
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Action.pm
CommitLineData
fbcc39ad 1package Catalyst::Action;
2
3use strict;
4use base qw/Class::Accessor::Fast/;
5
b96f127f 6__PACKAGE__->mk_accessors(qw/code namespace reverse prefix attributes/);
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
b96f127f 32=item attributes
33
fbcc39ad 34=item code
35
36=item execute
37
38=cut
39
40sub 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
49=item new
50
51=cut
52
53sub new { # Dumbass constructor
54 my ( $class, $attrs ) = @_;
55 return bless { %{ $attrs || {} } }, $class;
56}
57
58=back
59
60=head1 AUTHOR
61
62Matt S. Trout
63
64=head1 COPYRIGHT
65
66This program is free software, you can redistribute it and/or modify it under
67the same terms as Perl itself.
68
69=cut
70
711;