1 package Catalyst::AttrContainer;
5 #use base qw/Class::Accessor::Fast Class::Data::Inheritable/;
7 use Catalyst::Exception;
10 #dont want to ISA a C::D::I
11 use Class::Data::Inheritable;
13 my $mk_classdata = Class::Data::Inheritable->can('mk_classdata');
14 __PACKAGE__->meta->add_method(mk_classdata => $mk_classdata);
17 __PACKAGE__->mk_classdata($_) for qw/_attr_cache _action_cache/;
18 __PACKAGE__->_attr_cache( {} );
19 __PACKAGE__->_action_cache( [] );
21 # note - see attributes(3pm)
22 sub MODIFY_CODE_ATTRIBUTES {
23 my ( $class, $code, @attrs ) = @_;
24 $class->_attr_cache( { %{ $class->_attr_cache }, $code => [@attrs] } );
25 $class->_action_cache(
26 [ @{ $class->_action_cache }, [ $code, [@attrs] ] ] );
30 sub FETCH_CODE_ATTRIBUTES { $_[0]->_attr_cache->{ $_[1] } || () }
34 Catalyst::AttrContainer
40 This class sets up the code attribute cache. It's a base class for
41 L<Catalyst::Controller>.
45 =head2 FETCH_CODE_ATTRIBUTES
47 Attribute function. See attributes(3pm)
49 =head2 MODIFY_CODE_ATTRIBUTES
51 Attribute function. See attributes(3pm)
55 L<Catalyst::Dispatcher>
60 Sebastian Riedel, C<sri@cpan.org>
61 Marcus Ramberg, C<mramberg@cpan.org>
65 This program is free software, you can redistribute it and/or modify it under
66 the same terms as Perl itself.