1 package Catalyst::AttrContainer;
4 use Catalyst::Exception;
5 use Scalar::Util 'blessed';
6 with 'Catalyst::ClassData';
10 __PACKAGE__->mk_classdata(_attr_cache => {} );
11 __PACKAGE__->mk_classdata( _action_cache => [] );
13 # note - see attributes(3pm)
14 sub MODIFY_CODE_ATTRIBUTES {
15 my ( $class, $code, @attrs ) = @_;
16 $class->_attr_cache( { %{ $class->_attr_cache }, $code => [@attrs] } );
17 $class->_action_cache(
18 [ @{ $class->_action_cache }, [ $code, [@attrs] ] ] );
22 sub FETCH_CODE_ATTRIBUTES { $_[0]->_attr_cache->{ $_[1] } || () }
26 Catalyst::AttrContainer - Handles code attribute storage and caching
32 This class sets up the code attribute cache. It's a base class for
33 L<Catalyst::Controller>.
37 =head2 FETCH_CODE_ATTRIBUTES
39 Attribute function. See attributes(3pm)
41 =head2 MODIFY_CODE_ATTRIBUTES
43 Attribute function. See attributes(3pm)
47 L<Catalyst::Dispatcher>
52 Catalyst Contributors, see Catalyst.pm
56 This program is free software, you can redistribute it and/or modify it under
57 the same terms as Perl itself.