X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FComponent.pm;h=ee1f99ac33451b25ea197d8c67d7f3e42c6b7e27;hb=d2598ac82e8508f4d6da90ec60a1ed60840c2016;hp=d0692785239aef60e4ea92e2395ff8f916ac47c6;hpb=fb0c5b21c3c972bc88b8c6c481f9937f31658a23;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Component.pm b/lib/Catalyst/Component.pm index d069278..ee1f99a 100644 --- a/lib/Catalyst/Component.pm +++ b/lib/Catalyst/Component.pm @@ -60,7 +60,14 @@ component loader with config() support and a process() method placeholder. __PACKAGE__->mk_classdata('_plugins'); __PACKAGE__->mk_classdata('_config'); -has _component_name => ( is => 'ro' ); +has _component_name => ( is => 'ro' ); # Cannot be required => 1 as context + # class @ISA component - HATE +# Make accessor callable as a class method, as we need to call setup_actions +# on the application class, which we don't have an instance of, ewwwww +around _component_name => sub { + my ($orig, $self) = (shift, shift); + blessed($self) ? $self->$orig(@_) : $self; +}; sub BUILDARGS { my $class = shift; @@ -172,14 +179,6 @@ something like this: return $class->new($app, $args); } -=head2 _component_class - -The class name of the component within an application. This is used to -pass the component's class name to actions generated (becoming -C<< $action->class >>). This is needed so that the L method can -return an instance of a different class (e.g. a L anonymous class), -and should be used to retrieve a component instead of C<< ref($self) >>. - =head2 $c->config =head2 $c->config($hashref)