X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAttrContainer.pm;h=443b4162098a2679b86509ee759242d59f214b19;hb=4ac0b9cb8e9043db8a95f44af685c782bf9426e7;hp=2e50cec0f562d2fad254c11ecb218639a010a681;hpb=f1634af6f0980ab7addd20dc5d90eea89b13f581;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/AttrContainer.pm b/lib/Catalyst/AttrContainer.pm index 2e50cec..443b416 100644 --- a/lib/Catalyst/AttrContainer.pm +++ b/lib/Catalyst/AttrContainer.pm @@ -1,28 +1,18 @@ package Catalyst::AttrContainer; use Moose; -use MooseX::ClassAttribute; use Catalyst::Exception; +with 'Catalyst::ClassData'; -class_has _attr_cache => ( - is => 'rw', - isa => 'HashRef', - required => 1, - default => sub{{}} - ); -class_has _action_cache => ( - is => 'rw', - isa => 'ArrayRef', - required => 1, - default => sub{ [] } - ); +no Moose; + +__PACKAGE__->mk_classdata(_attr_cache => {} ); +__PACKAGE__->mk_classdata( _action_cache => [] ); # note - see attributes(3pm) sub MODIFY_CODE_ATTRIBUTES { my ( $class, $code, @attrs ) = @_; - #can't the below just be $class->_attr_cache->{$code} = \@attrs; ? $class->_attr_cache( { %{ $class->_attr_cache }, $code => [@attrs] } ); - #why can't this just be push @{$class->_action_cache}, [$code, \@attrs] ? $class->_action_cache( [ @{ $class->_action_cache }, [ $code, [@attrs] ] ] ); return (); @@ -32,13 +22,13 @@ 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 +This class sets up the code attribute cache. It's a base class for L. =head1 METHODS @@ -56,10 +46,9 @@ Attribute function. See attributes(3pm) L L. -=head1 AUTHOR +=head1 AUTHORS -Sebastian Riedel, C -Marcus Ramberg, C +Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT