From: Brian Candler Date: 2010-04-27T23:18:39+09:00 Subject: Re: Variable number of arguments for methods called with "send" Pierre Lecocq wrote: > But if I want to call a method with arguments, I am stuck because I do > not know how many arguments it needs and what is the "kind" of arguments > (can be "static arguments" - arg1, arg2 - or VARGS - *args - ) There is no difference between those cases. args = [] send(:foo, *args) # same as: send(:foo) args = ["abc"] send(:foo, *args) # same as: send(:foo, "abc") args = ["abc","def"] send(:foo, *args) # same as: send(:foo, "abc", "def") HTH, Brian. -- Posted via http://www.ruby-forum.com/.