我可以访问方法中的另一种方法我可以访问另一种方法内的方法吗?
def one(a)
if a < 10
two()
else
print "ITs passed in first function ONE"
end
end
def two(b)
if b < 10
print "Both function failed"
else
print "ITs passed in second function TWO"
end
end
puts one(5)
puts two(15)
如果我运行这个程序,我得到一个错误
test4.rb:9:in `two': wrong number of arguments (0 for 1) (ArgumentError)
请仔细阅读错误消息。 – 2014-11-08 02:15:17
at'two()' - 'two'想要一个参数 – August 2014-11-08 02:18:10
是的,我不明白,你能请elobarate? – user2996524 2014-11-08 02:21:26