X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FAttrContainer.pm;h=921a886931aecfad3fa448db86273272d397245e;hp=23ca0a1d16531c48bcfee58fb3477992b6d7ca5b;hb=2f3812528068bc1d9f7840067f0c03d36cd47e6d;hpb=91d4abc5cc6b75fb46cef7aac04f3cb58f6b3551 diff --git a/lib/Catalyst/AttrContainer.pm b/lib/Catalyst/AttrContainer.pm index 23ca0a1..921a886 100644 --- a/lib/Catalyst/AttrContainer.pm +++ b/lib/Catalyst/AttrContainer.pm @@ -1,20 +1,21 @@ package Catalyst::AttrContainer; -use strict; -use base qw/Class::Data::Inheritable Class::Accessor::Fast/; - +use Moose; use Catalyst::Exception; -use NEXT; +use Scalar::Util 'blessed'; +with 'Catalyst::ClassData'; + +no Moose; -__PACKAGE__->mk_classdata($_) for qw/_attr_cache _action_cache/; -__PACKAGE__->_attr_cache( {} ); -__PACKAGE__->_action_cache( [] ); +__PACKAGE__->mk_classdata(_attr_cache => {} ); +__PACKAGE__->mk_classdata( _action_cache => [] ); # note - see attributes(3pm) sub MODIFY_CODE_ATTRIBUTES { my ( $class, $code, @attrs ) = @_; - $class->_attr_cache({ %{$class->_attr_cache}, $code => [@attrs] }); - $class->_action_cache([ @{$class->_action_cache}, [ $code, [@attrs] ] ]); + $class->_attr_cache( { %{ $class->_attr_cache }, $code => [@attrs] } ); + $class->_action_cache( + [ @{ $class->_action_cache }, [ $code, [@attrs] ] ] ); return (); } @@ -22,30 +23,33 @@ sub FETCH_CODE_ATTRIBUTES { $_[0]->_attr_cache->{ $_[1] } || () } =head1 NAME -Catalyst::AttrContainer +Catalyst::AttrContainer - Handles code attribute storage and caching =head1 SYNOPSIS =head1 DESCRIPTION +This class sets up the code attribute cache. It's a base class for +L. + =head1 METHODS -=over 4 +=head2 FETCH_CODE_ATTRIBUTES -=item FETCH_CODE_ATTRIBUTES +Attribute function. See attributes(3pm) -=item MODIFY_CODE_ATTRIBUTES +=head2 MODIFY_CODE_ATTRIBUTES -=back +Attribute function. See attributes(3pm) =head1 SEE ALSO +L L. -=head1 AUTHOR +=head1 AUTHORS -Sebastian Riedel, C -Marcus Ramberg, C +Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT