extended signature matching example
Robert 'phaylon' Sedlacek [Fri, 21 Aug 2009 21:23:20 +0000 (23:23 +0200)]
t/lib/TestApp/Controller/SignatureMatching.pm

index f787f78..fc66b2f 100644 (file)
@@ -2,17 +2,22 @@ use CatalystX::Declare;
 
 controller TestApp::Controller::SignatureMatching {
 
+    method mark (Catalyst $ctx) { 
+        $ctx->response->body( $ctx->action->reverse );
+    }
+
+
     action base as 'sigmatch' under '/';
 
     under base {
 
         final action int (Int $x) 
-            as 'test' { $ctx->response->body( $ctx->action->reverse ) }
+            as test { $self->mark($ctx) }
 
         final action str (Str $x where { /^[a-z]+$/ }) 
-            as 'test' { $ctx->response->body( $ctx->action->reverse ) }
+            as test { $self->mark($ctx) }
 
         final action rest (@) 
-            as '' { $ctx->response->body( $ctx->action->reverse ) }
+            as '' { $self->mark($ctx) }
     }
 }