1 package Catalyst::AttrContainer;
4 use MooseX::ClassAttribute;
5 use Catalyst::Exception;
7 class_has _attr_cache => (
13 clas_has _action_cache => (
20 # note - see attributes(3pm)
21 sub MODIFY_CODE_ATTRIBUTES {
22 my ( $class, $code, @attrs ) = @_;
23 #can't the below just be $class->_attr_cache->{$code} = \@attrs; ?
24 $class->_attr_cache( { %{ $class->_attr_cache }, $code => [@attrs] } );
25 #why can't this just be push @{$class->_action_cache}, [$code, \@attrs] ?
26 $class->_action_cache(
27 [ @{ $class->_action_cache }, [ $code, [@attrs] ] ] );
31 sub FETCH_CODE_ATTRIBUTES { $_[0]->_attr_cache->{ $_[1] } || () }
35 Catalyst::AttrContainer
41 This class sets up the code attribute cache. It's a base class for
42 L<Catalyst::Controller>.
46 =head2 FETCH_CODE_ATTRIBUTES
48 Attribute function. See attributes(3pm)
50 =head2 MODIFY_CODE_ATTRIBUTES
52 Attribute function. See attributes(3pm)
56 L<Catalyst::Dispatcher>
61 Sebastian Riedel, C<sri@cpan.org>
62 Marcus Ramberg, C<mramberg@cpan.org>
66 This program is free software, you can redistribute it and/or modify it under
67 the same terms as Perl itself.