From: Tomas Doran Date: Sat, 18 Jul 2009 09:56:17 +0000 (+0000) Subject: Add docs for changes X-Git-Tag: 5.80008~42^2~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=fb0c5b21c3c972bc88b8c6c481f9937f31658a23;hp=1b79e1994c40fc525b4a84c900a5c95ffd4a2f8a Add docs for changes --- diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index e9c9363..8d187a0 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -55,8 +55,6 @@ use overload ( no warnings 'recursion'; -#__PACKAGE__->mk_accessors(qw/class namespace reverse attributes name code/); - sub dispatch { # Execute ourselves against a context my ( $self, $c ) = @_; return $c->execute( $self->class, $self ); @@ -84,7 +82,7 @@ sub compare { my ($a1_args) = @{ $a1->attributes->{Args} || [] }; my ($a2_args) = @{ $a2->attributes->{Args} || [] }; - $_ = looks_like_number($_) ? $_ : ~0 + $_ = looks_like_number($_) ? $_ : ~0 for $a1_args, $a2_args; return $a1_args <=> $a2_args; @@ -105,7 +103,9 @@ and so on. This determines how the action is dispatched to. =head2 class -Returns the class name where this action is defined. +Returns the class name of the component where this action is defined. +Derived by calling the L +method on each component. =head2 code diff --git a/lib/Catalyst/Component.pm b/lib/Catalyst/Component.pm index 0fbca47..d069278 100644 --- a/lib/Catalyst/Component.pm +++ b/lib/Catalyst/Component.pm @@ -172,6 +172,14 @@ 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)