DRbObject does this with the magic of routing remote mail using #method_missing . So, we need to undefine the #send method from foo , so it delegates instead of #method_missing !
foo.singleton_class.class_eval { undef_method :send }
Or do it in a more object oriented way:
AdapterDRbObject < DRbObject undef_method :send end
Regarding whether you need to do this, this is for discussion.
Actually, itβs βnormalβ to override / delete #send , because everything is supposed to know that you should always call #__send__ . (Actually, if you look at DRbObject#method_missing , it calls #__send__ .)
#send , #send other hand, is a pretty basic Ruby concept and can confuse future code maintainers.
source share