3 ms·
It's (perhaps) worth noting that Object#returning is part of ActiveSupport, not the Ruby Standard Library.
by pius 18y ago
It's (perhaps) worth noting that Object#returning is part of ActiveSupport, not the Ruby Standard Library.
- raganwald 18y agoTrue, and worth noting. Also of interest: Ruby 1.9 includes a different implementation of the K Combinator, Object#tap. It's a method rather than a pseudo-function, so instead of: returning (Fubar.new) do |f| ... end Your write: Fubar.new.tap do |f| ... end Shameless plug-whoring: The andand gem includes an enhanced Object#tap: http://andand.rubyforge.org http://andand.rubyforge.org