This is a pretty long method here, and it is not handling its arguments well. "whatever" is treated as an array on line 24, but as an integer on line 21. Here's a simpler solution:
def multiply(\*inputs)
    inputs.flatten.inject(1, :\*)
  end
Using the \* in arguments means the argument will take any number of pieces of data (including arrays) and put them into an array, then you can handle it as such, iterating through.