98a8e3e39e45efbdc9fe873dd1238da25255d2b3
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Context.pm
1 package Catalyst::Context;
2
3 use Moose;
4
5 BEGIN { require 5.008004; }
6
7 has action => (is => 'rw');
8 has counter => (is => 'rw', default => sub { {} });
9 has namespace => (is => 'rw');
10 has request_class => (is => 'ro', default => 'Catalyst::Request');
11 has request => (is => 'rw', default => sub { $_[0]->request_class->new({}) }, required => 1, lazy => 1);
12 has response_class => (is => 'ro', default => 'Catalyst::Response');
13 has response => (is => 'rw', default => sub { $_[0]->response_class->new({}) }, required => 1, lazy => 1);
14 has stack => (is => 'ro', default => sub { [] });
15 has stash => (is => 'rw', default => sub { {} });
16 has state => (is => 'rw', default => 0);
17 has stats => (is => 'rw');
18
19 # Remember to update this in Catalyst::Runtime as well!
20
21 our $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
30 no Moose;
31
32 __PACKAGE__->meta->make_immutable;
33
34 1;
35
36 __END__
37
38 =head1 NAME
39
40 Catalyst::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
68 L<Catalyst>, L<Catalyst::Model>, L<Catalyst::View>, L<Catalyst::Controller>.
69
70 =head1 AUTHORS
71
72 Catalyst Contributors, see Catalyst.pm
73
74 =head1 COPYRIGHT
75
76 This library is free software. You can redistribute it and/or modify it under
77 the same terms as Perl itself.
78
79 =cut
80