ruby unbind 方法的使用场景

class Test  def initialize(value)    @x = value  end  def my_method    @x  endendtest = Test.new(1)m = test.method :my_methodputs "test.my_method is #{m.call}"unbind = m.unbindtest_2 = Test.new(2)m = unbind.bind(test_2)puts "-"*30puts "test_2.my_method is #{m.call}"

** 这里我有一个疑问 **

bind 和unbind 使用场景是什么?

ruby unbind 方法的使用场景

相关文章:

你感兴趣的文章:

标签云: