in ruby I can bind a method to a receiver (instance):
class TEST
def meth
end
end
bound_method = TEST.new.method(:meth)
Question: How I can get the reveiver from a bound method back?
possible solution, found in docs:
/*
* call-seq:
* binding.receiver -> object
*
* Returns the bound receiver of the binding object.
*/
static VALUE
bind_receiver(VALUE bindval)
{
const rb_binding_t *bind;
GetBindingPtr(bindval, bind);
return vm_block_self(&bind->block);
}