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=130006a244acde8057a021f022e01949688cdc94;hb=4082e67814e85bc9820e56eb38e5e21511c0a5f8;hpb=b5ecfcf07b8ffe7e9984f0279c8781ce51c6ac6a diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index 130006a..8e5ea75 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -13,6 +13,9 @@ use overload ( # Codulate to encapsulated action coderef '&{}' => sub { shift->{code} }, + # Make general $stuff still work + fallback => 1, + ); =head1 NAME @@ -43,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