Hi there -
So, I’m sorry for this very basic question which makes me feel like a
real dummy… But honestly I couldn’t find the answer from many internet
tutorials, nor from the book I am reading, called “Ruby: the
foundations…”.
So, pretty basic, I have a test.rb file which contains:
def fonction1
puts “Here we are - func1”
end
def fonction2
puts “Here we are - func2”
end
def test(*arg)
countArgs = 0;
arg.each {|param|
t[countArgs] = param
countArgs = countArgs+1
}
countArgs = countArgs+1
puts “You called me with #{count-args} argument(s) as parameters”
return t
end
Now, I’m still trying to figure out the COMMAND LINE to eventually
execute my test() function of test.rb.
I want to try on different cases, test(a,b,c), test(“yoyo”, “yaya”), …
I tried ruby test.rb test() , but of course, this isn’t it.
Let me know if I’m totally out of the concept here ?!