I have a method that should accept 1+ parameters of any class, similar to Array # push :
def my_push(*objects) raise ArgumentError, 'Needs 1+ arguments' if objects.empty? objects.each do |obj| puts "An object was pushed: #{obj.inspect}" @my_array.push obj end end
What is the best way to document method parameters using YARD syntax?
Edit:
I understand that my initial question was too vague and did not quite determine what I was looking for.
A better question would be, what is the best way to specify the arity of the method (1-∞ in this case) in YARD when using the splatted parameter? I know that I can just specify it in the text, but it seems that there should be a tag or something like that to indicate arity.
ruby parameters documentation splat yard
hololeap
source share