X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAttrContainer.pm;h=dae87dc12e21a30d2d142ea143f0e2ec2ec088d8;hb=4cfa1efab08273928363729c3843f18a3a66a4c4;hp=fecfdcdc2dbab563c8404b1cd7ba92c236fb8e29;hpb=b5ecfcf07b8ffe7e9984f0279c8781ce51c6ac6a;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/AttrContainer.pm b/lib/Catalyst/AttrContainer.pm index fecfdcd..dae87dc 100644 --- a/lib/Catalyst/AttrContainer.pm +++ b/lib/Catalyst/AttrContainer.pm @@ -1,19 +1,28 @@ package Catalyst::AttrContainer; -use strict; -use base qw/Class::Data::Inheritable Class::Accessor::Fast/; - +use Moose; +use MooseX::ClassAttribute; use Catalyst::Exception; -use NEXT; -__PACKAGE__->mk_classdata($_) for qw/_attr_cache _action_cache/; -__PACKAGE__->_attr_cache( {} ); -__PACKAGE__->_action_cache( [] ); +class_has _attr_cache => ( + is => 'rw', + isa => 'HashRef', + required => 1, + default => sub{{}} + ); +clas_has _action_cache => ( + is => 'rw', + isa => 'ArrayRef', + required => 1, + default => sub{ [] } + ); # 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 (); @@ -29,14 +38,22 @@ Catalyst::AttrContainer =head1 DESCRIPTION +This class sets up the code attribute cache. It's a base class for +L. + =head1 METHODS =head2 FETCH_CODE_ATTRIBUTES +Attribute function. See attributes(3pm) + =head2 MODIFY_CODE_ATTRIBUTES +Attribute function. See attributes(3pm) + =head1 SEE ALSO +L L. =head1 AUTHOR