Mega Code Archive

 
Categories / Ruby / Method
 

Passing a Variable Number of Arguments

def putter(first_word, *others)   puts first_word + " " + others.join(" ") end putter "Hello", "from", "Ruby."