我可以訪問方法中的另一種方法我可以訪問另一種方法內的方法嗎?
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