Overload to stringify correctly
Guillermo Roditi [Mon, 23 Jun 2008 21:00:11 +0000 (21:00 +0000)]
r17008@martha (orig r7521):  marcus | 2008-03-25 15:11:29 -0400

lib/Catalyst/ActionContainer.pm

index ee7cfa7..ca36862 100644 (file)
@@ -17,6 +17,13 @@ to represent the various dispatch points in your application.
 
 use Moose;
 
+use overload (
+
+    # Stringify to path part for tree search
+    q{""} => sub { shift->part },
+
+);
+
 has part    => (is => 'rw', required => 1, lazy => 1, default => sub { {} });
 has actions => (is => 'rw', required => 1, lazy => 1, default => sub { {} });