X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FAction.pm;h=4469a1d6474932bd06c9d8753f7a3c930332af85;hp=a1e2e41b36d28dd6b49f081fbb3542e3fbcab881;hb=6680c772eaa987eafdb32e9437fd2d649dc914d9;hpb=e5ecd5bc38bac3e2fcfaf643ea2a4c6ab46d7e57 diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index a1e2e41..4469a1d 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -10,7 +10,7 @@ Catalyst::Action - Catalyst Action =head1 DESCRIPTION -This class represents a Catalyst Action. You can access the object for the +This class represents a Catalyst Action. You can access the object for the currently dispatched action via $c->action. See the L for more information on how actions are dispatched. Actions are defined in L subclasses. @@ -19,12 +19,12 @@ L subclasses. use Moose; -has class => (is => 'rw'); -has namespace => (is => 'rw'); -has 'reverse' => (is => 'rw'); -has attributes => (is => 'rw'); -has name => (is => 'rw'); -has code => (is => 'rw'); +has class => (is => 'rw'); +has namespace => (is => 'rw'); +has 'reverse' => (is => 'rw'); +has attributes => (is => 'rw'); +has name => (is => 'rw'); +has code => (is => 'rw'); no Moose; @@ -49,15 +49,15 @@ sub dispatch { # Execute ourselves against a context my ( $self, $c ) = @_; #Moose todo: grrrrrr. this is no good. i don't know enough about it to # debug it though. why can't we just call the accessor? - local $c->{namespace} = $self->namespace; - return $c->execute( $self->class, $self ); + #local $c->{namespace} = $self->namespace; + #return $c->execute( $self->class, $self ); #believed to be equivalent: - #my $orig = $c->namespace; - #$c->namespace($self->namespace); - #my $ret = $c->execute( $self->class, $self ); - #$c->namespace($orig); - #return $ret; + my $orig = $c->namespace; + $c->namespace($self->namespace); + my $ret = $c->execute( $self->class, $self ); + $c->namespace($orig); + return $ret; } sub execute {