Ruby 请教个 ruby require 问题

akai76 · January 26, 2022 · Last by akai76 replied at May 29, 2022 · 410 hits

比如 require foo 然后调用 foo 里面的 bar 方法,直接用 bar() 而不是 foo.bar(). 这样会不会有很多重名问题

会。
重名的话,就用 foo.bar()

会有重名问题。约定是放到各自的 module 中。

Reply to Rei

那还要 include module 吗

You need to Sign in before reply, if you don't have an account, please Sign up first.