X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FComponent.pm;h=c065664d5d19c77772a20085671de6e5d4eb836c;hp=ee1f99ac33451b25ea197d8c67d7f3e42c6b7e27;hb=829b22f766b0b1d1a09a6ce152abe48ad9bde5ec;hpb=88fbc3be375826767516ba3a8e65f50cf768e52f diff --git a/lib/Catalyst/Component.pm b/lib/Catalyst/Component.pm index ee1f99a..c065664 100644 --- a/lib/Catalyst/Component.pm +++ b/lib/Catalyst/Component.pm @@ -60,14 +60,7 @@ component loader with config() support and a process() method placeholder. __PACKAGE__->mk_classdata('_plugins'); __PACKAGE__->mk_classdata('_config'); -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; -}; +has _component_name => ( is => 'ro' ); sub BUILDARGS { my $class = shift; @@ -179,6 +172,15 @@ something like this: return $class->new($app, $args); } +=head2 _component_name + +The name of the component within an application. This is used to +pass the component's 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), +(as finding the component name by C<< ref($self) >> will not work correctly in +such cases). + =head2 $c->config =head2 $c->config($hashref)