插入到所有用到这个特性的脚本之前
def met *arg, &block yield arg[0], arg[1] end
alias :old_met :met def met *arg, &block old_met *arg[0, 2] {|a, b| puts a - b} yield arg[2], arg[3] end # 调用 met(1,2,3,4) {|a, b| puts a + b} #=> -1,7
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |