You can do using a comma:
a, b = function
In fact, function
returns an array of two elements:
def function
return 1,2
end
=> nil
function
=> [1, 2]
And you are desconstructing the array - that is each element from the array goes to one variable.
fun fact: The keyword return
is needed in this example.