Create a Mixin with a set of methods than can call to another class methods?

When you prepare instance_exec &Proc. New inside if statement, this statement is executed within instance of C class as context. You can verify this by adding puts self inside block for init(:foo) On the other hand, when you call yield block.

Call you yield thread execution into context of B class object (not to instance of this class, of course :) ). This place of your code doesn't know anything about C::c_method and this is cause of error.

When you prepare instance_exec &Proc. New inside if statement, this statement is executed within instance of C class as context. You can verify this by adding puts self inside block for init(:foo).

On the other hand, when you call yield block. Call you yield thread execution into context of B class object (not to instance of this class, of course :) ). This place of your code doesn't know anything about C::c_method and this is cause of error.

Yes, that's correct. I've tried to unbind the method from B and bind to C, that it doesn't work. I was trying to answer my question but I have no privileges, I nee to wait a few hours :) This link explains the issue – juandebravo Nov 10 at 10:37.

It seems that what I'm trying to do is to unbind the method :bar from B and bind to C, what it's not allowed. You can find more info in this great post M = Module. New class A class.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions