request related attributes into a Catalyst::Context object instead of storing it...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Context.pm
CommitLineData
54642e5a 1package Catalyst::Context;
2
3use Moose;
4
5BEGIN { require 5.008004; }
6
7has action => (is => 'rw');
8has counter => (is => 'rw', default => sub { {} });
9has namespace => (is => 'rw');
10has request_class => (is => 'ro', default => 'Catalyst::Request');
11has request => (is => 'rw', default => sub { $_[0]->request_class->new({}) }, required => 1, lazy => 1);
12has response_class => (is => 'ro', default => 'Catalyst::Response');
13has response => (is => 'rw', default => sub { $_[0]->response_class->new({}) }, required => 1, lazy => 1);
14has stack => (is => 'ro', default => sub { [] });
15has stash => (is => 'rw', default => sub { {} });
16has state => (is => 'rw', default => 0);
17has stats => (is => 'rw');
18
19# Remember to update this in Catalyst::Runtime as well!
20
21our $VERSION = '5.80013';
22
23{
24 my $dev_version = $VERSION =~ /_\d{2}$/;
25 *_IS_DEVELOPMENT_VERSION = sub () { $dev_version };
26}
27
28$VERSION = eval $VERSION;
29
30no Moose;
31
32__PACKAGE__->meta->make_immutable;
33
341;
35
36__END__
37
38=head1 NAME
39
40Catalyst::Context - object for keeping request related state
41
42=head1 ATTRIBUTES
43
44=head3 action
45
46=head3 counter
47
48=head3 namespace
49
50=head3 request_class
51
52=head3 request
53
54=head3 response_class
55
56=head3 response
57
58=head3 stack
59
60=head3 stash
61
62=head3 state
63
64=head3 stats
65
66=head1 SEE ALSO
67
68L<Catalyst>, L<Catalyst::Model>, L<Catalyst::View>, L<Catalyst::Controller>.
69
70=head1 AUTHORS
71
72Catalyst Contributors, see Catalyst.pm
73
74=head1 COPYRIGHT
75
76This library is free software. You can redistribute it and/or modify it under
77the same terms as Perl itself.
78
79=cut
80