X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAttrContainer.pm;h=ddfe0ab22cc09f3b5cec586202fb864610cbcc15;hb=e7dc25cd71e0b09ba2a457b240d5d922e0279507;hp=dae87dc12e21a30d2d142ea143f0e2ec2ec088d8;hpb=4cfa1efab08273928363729c3843f18a3a66a4c4;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/AttrContainer.pm b/lib/Catalyst/AttrContainer.pm index dae87dc..ddfe0ab 100644 --- a/lib/Catalyst/AttrContainer.pm +++ b/lib/Catalyst/AttrContainer.pm @@ -1,28 +1,27 @@ package Catalyst::AttrContainer; use Moose; -use MooseX::ClassAttribute; +#use strict; +#use base qw/Class::Accessor::Fast Class::Data::Inheritable/; + use Catalyst::Exception; +use NEXT; + +#dont want to ISA a C::D::I +use Class::Data::Inheritable; +{ + my $mk_classdata = Class::Data::Inheritable->can('mk_classdata'); + __PACKAGE__->meta->add_method(mk_classdata => $mk_classdata); +} -class_has _attr_cache => ( - is => 'rw', - isa => 'HashRef', - required => 1, - default => sub{{}} - ); -clas_has _action_cache => ( - is => 'rw', - isa => 'ArrayRef', - required => 1, - default => sub{ [] } - ); +__PACKAGE__->mk_classdata($_) for qw/_attr_cache _action_cache/; +__PACKAGE__->_attr_cache( {} ); +__PACKAGE__->_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 ();