2 ms·
I mean that I prefer chaining the methods rather than passing the method name as a symbol to try. You're right, the name 'andand' isnt as clear as 'try,' it co
by JonnieCache 16y ago
I mean that I prefer chaining the methods rather than passing the method name as a symbol to try.
You're right, the name 'andand' isnt as clear as 'try,' it comes from its creation as a replacement for the use of the && operator as a guard.
If try() returned a proxy object that used method_missing to accept method calls rather than just being passed a symbol, we'd have the best of both worlds.
It is unfortunately a fairly wanton case of demeter violation, but rails is pretty much based on wanton demeter violation anyway, or at least it feels like that at times. Generally the times when I'm trying to write integration tests for some overly clever library.