Reputation: 14504
What is *args or *urls if I write a method like:
def test(*args)
@test = args
end
I have also seen *urls
is it an array or? Like options are created with hash options = {}
.
Upvotes: 2
Views: 2854
Reputation: 490133
I believe this is to make the function variadic (i.e. the function's arity is an arbitrary number of arguments).
The type is an Array.
Upvotes: 4
Reputation: 70931
Try this(it should answer your question):
def test *args
puts args.class
end
test
>> Array
Upvotes: 3