Mega Code Archive

 
Categories / Ruby / Method
 

Ruby makes it easy to handle multiple return values - no need to work with arrays explicitly at all

# All you have to do is to assign the return value of the called method to a comma-separated list of variables def greeting()   return "No", "worries" end word_one, word_two = greeting