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=83b4da3937bd7b700372d5d3c849bca2fb2eaccd;hp=2023303746035233aa6aa79806bbfa412cad320b;hb=38007d99db1774891d373242c86382e6f5cb083a;hpb=5fb12dbb7e69039e0ea22ec4d7cb627206b4508b diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index 2023303..83b4da3 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -28,14 +28,10 @@ has code => (is => 'rw'); no Moose; -no warnings 'recursion'; - -#__PACKAGE__->mk_accessors(qw/class namespace reverse attributes name code/); - use overload ( # Stringify to reverse for debug output etc. - q{""} => sub { shift->reverse() }, + q{""} => sub { shift->{reverse} }, # Codulate to execute to invoke the encapsulated action coderef '&{}' => sub { my $self = shift; sub { $self->execute(@_); }; }, @@ -45,19 +41,15 @@ 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 ) = @_; - #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 ); - - #believed to be equivalent: - #my $orig = $c->namespace; - #$c->namespace($self->namespace); - #my $ret = $c->execute( $self->class, $self ); - #$c->namespace($orig); - #return $ret; } sub execute { @@ -127,9 +119,9 @@ returns the sub name of this action. Provided by Moose -=head1 AUTHOR +=head1 AUTHORS -Matt S. Trout +Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT