add C::DispatchType::_is_low_precedence
Rafael Kitover [Thu, 25 Jun 2009 00:41:38 +0000 (00:41 +0000)]
lib/Catalyst/DispatchType.pm
lib/Catalyst/DispatchType/Default.pm
lib/Catalyst/DispatchType/Index.pm
lib/Catalyst/Dispatcher.pm

index 75de1c5..0cde651 100644 (file)
@@ -73,6 +73,8 @@ about expand_action.
 
 sub expand_action { }
 
+sub _is_low_precedence { 0 }
+
 =head1 AUTHORS
 
 Catalyst Contributors, see Catalyst.pm
index a642eea..6586351 100644 (file)
@@ -58,6 +58,8 @@ sub match {
     return 0;
 }
 
+sub _is_low_precedence { 1 }
+
 =head1 AUTHORS
 
 Catalyst Contributors, see Catalyst.pm
index d55ca00..c0be9e6 100644 (file)
@@ -89,6 +89,8 @@ sub uri_for_action {
     return "/".$action->namespace;
 }
 
+sub _is_low_precedence { 1 }
+
 =head1 AUTHORS
 
 Catalyst Contributors, see Catalyst.pm
index 680a76b..9249f1c 100644 (file)
@@ -531,8 +531,7 @@ sub register {
     my @low_precedence_dtypes;
 
     for my $type ( @dtypes ) {
-        if ($type->isa('Catalyst::DispatchType::Index') ||  
-            $type->isa('Catalyst::DispatchType::Default')) {
+        if ($type->_is_low_precedence) {
             push @low_precedence_dtypes, $type;
         } else {
             push @normal_dtypes, $type;