Make ActionChain stringify to its part attribute.
Florian Ragwitz [Mon, 8 Sep 2008 13:26:21 +0000 (13:26 +0000)]
This is used in the listing of private actions in debug mode.

lib/Catalyst/ActionContainer.pm

index 2f98be1..5be7292 100644 (file)
@@ -27,6 +27,11 @@ around new => sub {
 
 no Moose;
 
+use overload (
+    # Stringify to path part for tree search
+    q{""} => sub { shift->part },
+);
+
 sub get_action {
     my ( $self, $name ) = @_;
     return $self->actions->{$name} if defined $self->actions->{$name};