middleware/proxy: favor __send__ for method dispatch
commit506df98df1dae59281fbb3b3c2c6bea7549a2288
authorEric Wong <normalperson@yhbt.net>
Thu, 7 Jun 2012 21:36:35 +0000 (7 14:36 -0700)
committerEric Wong <normalperson@yhbt.net>
Thu, 7 Jun 2012 21:43:09 +0000 (7 14:43 -0700)
tree792e532e9daa4d89f6ce6006ec8f2eedd6869fcf
parentbd7236fe23c4388d2fa42a4f836aca3c796dabab
middleware/proxy: favor __send__ for method dispatch

"send" is more likely to be overridden in subclasses whereas
the Ruby runtime (at least 1.9.3) will warn loudly if any user
code (re)defines the "__send__" method.

For example, BasicSocket#send and UDPSocket#send in the Ruby
stdlib are wrappers for the send(2)/sendto(2) system calls,
and it's entirely possible an application could return a
Socket-subclass as a Rack response body.
lib/raindrops/middleware/proxy.rb