Commit | Line | Data |
ba599d1c |
1 | package Catalyst::AttrContainer; |
2 | |
e7dc25cd |
3 | use Moose; |
ba599d1c |
4 | use Catalyst::Exception; |
ba599d1c |
5 | |
a7caa492 |
6 | with 'Catalyst::ClassData'; |
e7dc25cd |
7 | |
e8b9f2a9 |
8 | __PACKAGE__->mk_classdata($_) for qw/_attr_cache _action_cache/; |
9 | __PACKAGE__->_attr_cache( {} ); |
10 | __PACKAGE__->_action_cache( [] ); |
ba599d1c |
11 | |
12 | # note - see attributes(3pm) |
13 | sub MODIFY_CODE_ATTRIBUTES { |
14 | my ( $class, $code, @attrs ) = @_; |
57e45928 |
15 | $class->_attr_cache( { %{ $class->_attr_cache }, $code => [@attrs] } ); |
16 | $class->_action_cache( |
17 | [ @{ $class->_action_cache }, [ $code, [@attrs] ] ] ); |
ba599d1c |
18 | return (); |
19 | } |
20 | |
21 | sub FETCH_CODE_ATTRIBUTES { $_[0]->_attr_cache->{ $_[1] } || () } |
22 | |
23 | =head1 NAME |
24 | |
25 | Catalyst::AttrContainer |
26 | |
27 | =head1 SYNOPSIS |
28 | |
29 | =head1 DESCRIPTION |
30 | |
e7dc25cd |
31 | This class sets up the code attribute cache. It's a base class for |
a1e61a69 |
32 | L<Catalyst::Controller>. |
649fd1fa |
33 | |
ba599d1c |
34 | =head1 METHODS |
35 | |
b5ecfcf0 |
36 | =head2 FETCH_CODE_ATTRIBUTES |
ba599d1c |
37 | |
649fd1fa |
38 | Attribute function. See attributes(3pm) |
39 | |
b5ecfcf0 |
40 | =head2 MODIFY_CODE_ATTRIBUTES |
ba599d1c |
41 | |
649fd1fa |
42 | Attribute function. See attributes(3pm) |
43 | |
ba599d1c |
44 | =head1 SEE ALSO |
45 | |
a1e61a69 |
46 | L<Catalyst::Dispatcher> |
ba599d1c |
47 | L<Catalyst>. |
48 | |
49 | =head1 AUTHOR |
50 | |
51 | Sebastian Riedel, C<sri@cpan.org> |
52 | Marcus Ramberg, C<mramberg@cpan.org> |
53 | |
54 | =head1 COPYRIGHT |
55 | |
56 | This program is free software, you can redistribute it and/or modify it under |
57 | the same terms as Perl itself. |
58 | |
59 | =cut |
60 | |
61 | 1; |