Commit | Line | Data |
---|---|---|
ba599d1c | 1 | package Catalyst::AttrContainer; |
2 | ||
e7dc25cd | 3 | use Moose; |
ba599d1c | 4 | use Catalyst::Exception; |
76aab993 | 5 | use Scalar::Util 'blessed'; |
46d0346d | 6 | with 'Catalyst::ClassData'; |
e7dc25cd | 7 | |
0fc2d522 | 8 | no Moose; |
9 | ||
46d0346d | 10 | __PACKAGE__->mk_classdata(_attr_cache => {} ); |
11 | __PACKAGE__->mk_classdata( _action_cache => [] ); | |
ba599d1c | 12 | |
13 | # note - see attributes(3pm) | |
14 | sub MODIFY_CODE_ATTRIBUTES { | |
15 | my ( $class, $code, @attrs ) = @_; | |
57e45928 | 16 | $class->_attr_cache( { %{ $class->_attr_cache }, $code => [@attrs] } ); |
17 | $class->_action_cache( | |
18 | [ @{ $class->_action_cache }, [ $code, [@attrs] ] ] ); | |
ba599d1c | 19 | return (); |
20 | } | |
21 | ||
22 | sub FETCH_CODE_ATTRIBUTES { $_[0]->_attr_cache->{ $_[1] } || () } | |
23 | ||
24 | =head1 NAME | |
25 | ||
2f381252 | 26 | Catalyst::AttrContainer - Handles code attribute storage and caching |
ba599d1c | 27 | |
28 | =head1 SYNOPSIS | |
29 | ||
30 | =head1 DESCRIPTION | |
31 | ||
ac5c933b | 32 | This class sets up the code attribute cache. It's a base class for |
a1e61a69 | 33 | L<Catalyst::Controller>. |
649fd1fa | 34 | |
ba599d1c | 35 | =head1 METHODS |
36 | ||
b5ecfcf0 | 37 | =head2 FETCH_CODE_ATTRIBUTES |
ba599d1c | 38 | |
649fd1fa | 39 | Attribute function. See attributes(3pm) |
40 | ||
b5ecfcf0 | 41 | =head2 MODIFY_CODE_ATTRIBUTES |
ba599d1c | 42 | |
649fd1fa | 43 | Attribute function. See attributes(3pm) |
44 | ||
ba599d1c | 45 | =head1 SEE ALSO |
46 | ||
a1e61a69 | 47 | L<Catalyst::Dispatcher> |
ba599d1c | 48 | L<Catalyst>. |
49 | ||
2f381252 | 50 | =head1 AUTHORS |
ba599d1c | 51 | |
2f381252 | 52 | Catalyst Contributors, see Catalyst.pm |
ba599d1c | 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; |