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=8e5ea75990178c49fa32edc7f7cdef5febcbd26d;hp=0002ef7e230e67ddd47bd5158486738a03fe105d;hb=4082e67814e85bc9820e56eb38e5e21511c0a5f8;hpb=855ed93153e2b0c0e88d9bb8f23822c914393048 diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index 0002ef7..8e5ea75 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -46,6 +46,16 @@ sub execute { # Execute ourselves against a context return $c->execute( $self->class, $self ); } +=head2 match + +=cut + +sub match { + my ( $self, $c ) = @_; + return 1 unless exists $self->attributes->{Args}; + return scalar(@{$c->req->args}) == $self->attributes->{Args}[0]; +} + =head2 namespace =head2 reverse