Skip to content

Commit

Permalink
[Astaire] now accepts a @Splat parameter
Browse files Browse the repository at this point in the history
Not 100% sure about this addition, but it does what the tests propose.
  • Loading branch information
Carl Masak committed Dec 7, 2009
1 parent 12a36e4 commit a365ca1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Astaire.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ class Dispatch {
&& $candidate.http_method eq $request.request_method {
my $code = $candidate.code;
my $body;
if $code.arity {
if $code.signature.params == 1
&& $code.signature.params[0].name eq '@splat' {
$body = $code(:splat(%match<splat>));
}
elsif $code.arity {
$body = $code(|%match<splat>);
}
else {
Expand Down

0 comments on commit a365ca1

Please sign in to comment.