Scenario: A method takes arguments in this fashion
def my_method(model_name, id, attribute_1, attribute_2)
# ...
end
All parameters are unknown, so I am fetching the model name from the object's class name, and the attributes I am fetching from that class returned as an array.
Problem: I have an array ["x", "y", "z"]. I need to take the items from each array and pass them into the method parameters after the Model as illustrated above.
Is it even possible to "drop the brackets" from an array so to speak, but keep the items and their order in tact?
*you could just writemy_method(model_name, ary[0], ary[1], ary[2]), not much of a problem here ;-)