diff options
author | Leon Breedt <bitserf@gmail.com> | 2005-03-26 00:20:19 +0000 |
---|---|---|
committer | Leon Breedt <bitserf@gmail.com> | 2005-03-26 00:20:19 +0000 |
commit | 8032c4ffd47ba4deb5cbd88a462b837240eb593c (patch) | |
tree | 644884307c403b47c883a4c699ea0c8472fd75ac /actionwebservice/lib/action_web_service/dispatcher/abstract.rb | |
parent | 771244a58ce812198e7171e4ee0ae5b27032ead0 (diff) | |
download | rails-8032c4ffd47ba4deb5cbd88a462b837240eb593c.tar.gz rails-8032c4ffd47ba4deb5cbd88a462b837240eb593c.tar.bz2 rails-8032c4ffd47ba4deb5cbd88a462b837240eb593c.zip |
allow direct dispatching methods to declare their parameters as well, for brevity's sake, it seems
to be counter-intuitive not to do so (closes #939). update gem require versions.
fix unit tests for exception de-shallowing changes.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@992 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib/action_web_service/dispatcher/abstract.rb')
-rw-r--r-- | actionwebservice/lib/action_web_service/dispatcher/abstract.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionwebservice/lib/action_web_service/dispatcher/abstract.rb b/actionwebservice/lib/action_web_service/dispatcher/abstract.rb index 1df03d1777..b63fe65ce1 100644 --- a/actionwebservice/lib/action_web_service/dispatcher/abstract.rb +++ b/actionwebservice/lib/action_web_service/dispatcher/abstract.rb @@ -34,7 +34,12 @@ module ActionWebService # :nodoc: def web_service_direct_invoke(invocation) @method_params = invocation.method_ordered_params - return_value = self.__send__(invocation.api_method_name) + arity = method(invocation.api_method_name).arity rescue 0 + if arity < 0 || arity > 0 + return_value = self.__send__(invocation.api_method_name, *@method_params) + else + return_value = self.__send__(invocation.api_method_name) + end if invocation.api.has_api_method?(invocation.api_method_name) returns = invocation.returns ? invocation.returns[0] : nil else |