In a method definition, when * is used in the following manner, what does it mean?
def foo(*)
...
end
I understand the following usage:
def foo(*args)
...
end
I am not sure how I will access the method params in the former case.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It means “take and discard any number of parameters”.
Both definitions are technically the same, but not giving a name to the argument array means you can’t access it.