From: David Walker Date: 2006-11-08T11:39:11+09:00 Subject: Can't bind a singleton method to a subclass? The behavior of this snippet doesn't make sense to me: class A def A.class_method puts "Class method worked in #{self}" end end class B < A; end aklass = (class << A; self; end) bklass = (class << B; self; end) p RUBY_VERSION A.class_method B.class_method p A.method(:class_method) p B.method(:class_method) p aklass.instance_method(:class_method) p bklass.instance_method(:class_method) p A.method(:class_method).unbind p B.method(:class_method).unbind p A.method(:class_method).unbind.bind(A) p B.method(:class_method).unbind.bind(B) The output (for me) is: "1.8.4" Class method worked in A Class method worked in B # # ##class_method> ##class_method> ##class_method> ##class_method> # /workplace2/test.rb:24:in `bind': singleton method called for a different object (TypeError) from /workplace2/test.rb:24 In my mind, the last call should succeed, instead of raising an error. Is it just plain impossible to re-bind the method to yield a #? -- =D ave