Remove use of overload
[catagits/Catalyst-Runtime.git] / lib / Catalyst / AttrContainer.pm
CommitLineData
ba599d1c 1package Catalyst::AttrContainer;
2
e7dc25cd 3use Moose;
ba599d1c 4use Catalyst::Exception;
ba599d1c 5
a7caa492 6with 'Catalyst::ClassData';
e7dc25cd 7
0fc2d522 8no Moose;
9
e8b9f2a9 10__PACKAGE__->mk_classdata($_) for qw/_attr_cache _action_cache/;
11__PACKAGE__->_attr_cache( {} );
12__PACKAGE__->_action_cache( [] );
ba599d1c 13
14# note - see attributes(3pm)
15sub MODIFY_CODE_ATTRIBUTES {
16 my ( $class, $code, @attrs ) = @_;
57e45928 17 $class->_attr_cache( { %{ $class->_attr_cache }, $code => [@attrs] } );
18 $class->_action_cache(
19 [ @{ $class->_action_cache }, [ $code, [@attrs] ] ] );
ba599d1c 20 return ();
21}
22
23sub FETCH_CODE_ATTRIBUTES { $_[0]->_attr_cache->{ $_[1] } || () }
24
25=head1 NAME
26
27Catalyst::AttrContainer
28
29=head1 SYNOPSIS
30
31=head1 DESCRIPTION
32
ac5c933b 33This class sets up the code attribute cache. It's a base class for
a1e61a69 34L<Catalyst::Controller>.
649fd1fa 35
ba599d1c 36=head1 METHODS
37
b5ecfcf0 38=head2 FETCH_CODE_ATTRIBUTES
ba599d1c 39
649fd1fa 40Attribute function. See attributes(3pm)
41
b5ecfcf0 42=head2 MODIFY_CODE_ATTRIBUTES
ba599d1c 43
649fd1fa 44Attribute function. See attributes(3pm)
45
ba599d1c 46=head1 SEE ALSO
47
a1e61a69 48L<Catalyst::Dispatcher>
ba599d1c 49L<Catalyst>.
50
51=head1 AUTHOR
52
53Sebastian Riedel, C<sri@cpan.org>
54Marcus Ramberg, C<mramberg@cpan.org>
55
56=head1 COPYRIGHT
57
58This program is free software, you can redistribute it and/or modify it under
59the same terms as Perl itself.
60
61=cut
62
631;