aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionwebservice/lib')
-rw-r--r--actionwebservice/lib/action_web_service/api.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionwebservice/lib/action_web_service/api.rb b/actionwebservice/lib/action_web_service/api.rb
index 4548856d86..edc2ff17f4 100644
--- a/actionwebservice/lib/action_web_service/api.rb
+++ b/actionwebservice/lib/action_web_service/api.rb
@@ -182,6 +182,16 @@ module ActionWebService # :nodoc:
@caster.cast_returns(return_value)
end
+ # Returns the index of the first expected parameter
+ # with the given name
+ def expects_index_of(param_name)
+ return -1 if @expects.nil?
+ (0..(@expects.length-1)).each do |i|
+ return i if @expects[i].name.to_s == param_name.to_s
+ end
+ -1
+ end
+
# String representation of this method
def to_s
fqn = ""