X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction.pm;h=8e5ea75990178c49fa32edc7f7cdef5febcbd26d;hb=c82bce98625d13b20045499ddbb13b813a788ff3;hp=b2a094770978a434c030ba67019e68494a5fb044;hpb=261c571ec577304a8a41218a4576675c8099069a;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index b2a0947..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 @@ -27,15 +30,13 @@ See L. =head1 METHODS -=over 4 - -=item attributes +=head2 attributes -=item class +=head2 class -=item code +=head2 code -=item execute +=head2 execute =cut @@ -45,13 +46,21 @@ sub execute { # Execute ourselves against a context return $c->execute( $self->class, $self ); } -=item namespace +=head2 match + +=cut + +sub match { + my ( $self, $c ) = @_; + return 1 unless exists $self->attributes->{Args}; + return scalar(@{$c->req->args}) == $self->attributes->{Args}[0]; +} -=item reverse +=head2 namespace -=item name +=head2 reverse -=back +=head2 name =head1 AUTHOR