- Fixes for rt.cpan #17322 and #17331
[catagits/Catalyst-Runtime.git] / lib / Catalyst / AttrContainer.pm
CommitLineData
ba599d1c 1package Catalyst::AttrContainer;
2
3use strict;
4use base qw/Class::Data::Inheritable Class::Accessor::Fast/;
5
6use Catalyst::Exception;
7use NEXT;
8
9__PACKAGE__->mk_classdata($_) for qw/_attr_cache _action_cache/;
10__PACKAGE__->_attr_cache( {} );
11__PACKAGE__->_action_cache( [] );
12
13# note - see attributes(3pm)
14sub 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
22sub FETCH_CODE_ATTRIBUTES { $_[0]->_attr_cache->{ $_[1] } || () }
23
24=head1 NAME
25
26Catalyst::AttrContainer
27
28=head1 SYNOPSIS
29
30=head1 DESCRIPTION
31
32=head1 METHODS
33
b5ecfcf0 34=head2 FETCH_CODE_ATTRIBUTES
ba599d1c 35
b5ecfcf0 36=head2 MODIFY_CODE_ATTRIBUTES
ba599d1c 37
38=head1 SEE ALSO
39
40L<Catalyst>.
41
42=head1 AUTHOR
43
44Sebastian Riedel, C<sri@cpan.org>
45Marcus Ramberg, C<mramberg@cpan.org>
46
47=head1 COPYRIGHT
48
49This program is free software, you can redistribute it and/or modify it under
50the same terms as Perl itself.
51
52=cut
53
541;