reverting back to when tests pass. applying changes one by one to find what failed
[catagits/Catalyst-Runtime.git] / lib / Catalyst / AttrContainer.pm
CommitLineData
ba599d1c 1package Catalyst::AttrContainer;
2
e8b9f2a9 3use strict;
4use base qw/Class::Accessor::Fast Class::Data::Inheritable/;
5
ba599d1c 6use Catalyst::Exception;
e8b9f2a9 7use NEXT;
ba599d1c 8
e8b9f2a9 9__PACKAGE__->mk_classdata($_) for qw/_attr_cache _action_cache/;
10__PACKAGE__->_attr_cache( {} );
11__PACKAGE__->_action_cache( [] );
ba599d1c 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
e8b9f2a9 32This class sets up the code attribute cache. It's a base class for
a1e61a69 33L<Catalyst::Controller>.
649fd1fa 34
ba599d1c 35=head1 METHODS
36
b5ecfcf0 37=head2 FETCH_CODE_ATTRIBUTES
ba599d1c 38
649fd1fa 39Attribute function. See attributes(3pm)
40
b5ecfcf0 41=head2 MODIFY_CODE_ATTRIBUTES
ba599d1c 42
649fd1fa 43Attribute function. See attributes(3pm)
44
ba599d1c 45=head1 SEE ALSO
46
a1e61a69 47L<Catalyst::Dispatcher>
ba599d1c 48L<Catalyst>.
49
50=head1 AUTHOR
51
52Sebastian Riedel, C<sri@cpan.org>
53Marcus Ramberg, C<mramberg@cpan.org>
54
55=head1 COPYRIGHT
56
57This program is free software, you can redistribute it and/or modify it under
58the same terms as Perl itself.
59
60=cut
61
621;