1 package Catalyst::AttrContainer;
4 use Catalyst::Exception;
6 with 'Catalyst::ClassData';
7 use Scalar::Util 'blessed';
11 __PACKAGE__->mk_classdata($_) for qw/_attr_cache _action_cache/;
12 __PACKAGE__->_attr_cache( {} );
13 __PACKAGE__->_action_cache( [] );
15 # note - see attributes(3pm)
16 sub MODIFY_CODE_ATTRIBUTES {
17 my ( $class, $code, @attrs ) = @_;
18 $class->_attr_cache( { %{ $class->_attr_cache }, $code => [@attrs] } );
19 $class->_action_cache(
20 [ @{ $class->_action_cache }, [ $code, [@attrs] ] ] );
24 sub FETCH_CODE_ATTRIBUTES { $_[0]->_attr_cache->{ $_[1] } || () }
28 Catalyst::AttrContainer
34 This class sets up the code attribute cache. It's a base class for
35 L<Catalyst::Controller>.
39 =head2 FETCH_CODE_ATTRIBUTES
41 Attribute function. See attributes(3pm)
43 =head2 MODIFY_CODE_ATTRIBUTES
45 Attribute function. See attributes(3pm)
49 L<Catalyst::Dispatcher>
54 Sebastian Riedel, C<sri@cpan.org>
55 Marcus Ramberg, C<mramberg@cpan.org>
59 This program is free software, you can redistribute it and/or modify it under
60 the same terms as Perl itself.