If I have methods:
def method_a(p1, p2)
# do some stuff
method_b(p1, p2)
end
def method_b(p1, p2)
# do other stuff
end
Is there a way to call method_b
and automatically pass all parameters to it? (Sort like how you can call super
and it automatically forwards all params)
I know one appriximate method:
or expanding arguments in the second method:
Since
super
is key-work method, the ruby interperter can treat it as of the same argument list as in the specific method you've called. But default from to call a method without argument is the same as forsuper
method, just method name:So, it will be strong omonim for the call method syntax.