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=c3abb5b85e688e0cd059bbb7ca6adee091aecf88;hp=a74eb29f0ef1fa8cf986a784c3cca079a12757a8;hb=ba3c3e8604014602dee49df10bacaecdfce180a0;hpb=f3414019f472b55682ef3af53f761b6db7955887 diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index a74eb29..c3abb5b 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -17,7 +17,6 @@ L subclasses. =cut -use Class::C3; use Moose; has class => (is => 'rw'); @@ -29,6 +28,21 @@ has code => (is => 'rw'); no Moose; +use overload ( + + # Stringify to reverse for debug output etc. + q{""} => sub { shift->{reverse} }, + + # Codulate to execute to invoke the encapsulated action coderef + '&{}' => sub { my $self = shift; sub { $self->execute(@_); }; }, + + # Make general $stuff still work + fallback => 1, + +); + + + no warnings 'recursion'; #__PACKAGE__->mk_accessors(qw/class namespace reverse attributes name code/); @@ -115,9 +129,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