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=0002ef7e230e67ddd47bd5158486738a03fe105d;hp=f80c00bd84138c2792c53c47049ff0210c318dce;hb=6a0648863b2a3a4a745dc701d422b954cadc05b0;hpb=6b23994966a2a66b90986a51e7e1d71f62d90f44 diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index f80c00b..0002ef7 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -3,7 +3,7 @@ package Catalyst::Action; use strict; use base qw/Class::Accessor::Fast/; -__PACKAGE__->mk_accessors(qw/code namespace reverse prefix attributes name/); +__PACKAGE__->mk_accessors(qw/class namespace reverse attributes name code/); use overload ( @@ -13,6 +13,9 @@ use overload ( # Codulate to encapsulated action coderef '&{}' => sub { shift->{code} }, + # Make general $stuff still work + fallback => 1, + ); =head1 NAME @@ -27,37 +30,27 @@ See L. =head1 METHODS -=over 4 +=head2 attributes -=item attributes +=head2 class -=item code +=head2 code -=item execute +=head2 execute =cut sub execute { # Execute ourselves against a context my ( $self, $c ) = @_; - return $c->execute( $self->namespace, $self ); + local $c->namespace = $self->namespace; + return $c->execute( $self->class, $self ); } -=item namespace - -=item reverse - -=item name - -=item new +=head2 namespace -=cut - -sub new { # Dumbass constructor - my ( $class, $attrs ) = @_; - return bless { %{ $attrs || {} } }, $class; -} +=head2 reverse -=back +=head2 name =head1 AUTHOR