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=1a23b16b7f978f3ccecab9dda06d5ea7985f9943;hp=6758e862243f94c3960d896bacd492fe86f9c146;hb=2055d9ad6304f9db74cb05ec8ee0146ce319e8e4;hpb=4090e3bb3fea1a73ac369250e31584d61428b808 diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index 6758e86..1a23b16 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -28,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/);