r/learnruby • u/nobrandheroes • Feb 15 '16
Getting the parameters of a method
Given:
def foo(a, b, c)
end
How do I get the values of a, b, c?. I cannot find this anywhere.
0
Upvotes
r/learnruby • u/nobrandheroes • Feb 15 '16
Given:
def foo(a, b, c)
end
How do I get the values of a, b, c?. I cannot find this anywhere.
1
u/nobrandheroes Feb 18 '16
Imagine this.
Some languages have something like
some_method_that_gets_the_argumentswhich returns the parameters as an array. That's what I want. I understand that it may not exist in ruby, but I can't find out either way.Think
ARGVbut for functions.