It's just interesting if there is a syntax shortcut for accepting two procs and attaching them, so that the output of one of them is passed to the other, which is equivalent:
a = ->(x) { x + 1 } b = ->(x) { x * 10 } c = ->(x) { b.( a.( x ) ) }
This comes in handy when working with things like method(:abc).to_proc and :xyz.to_proc
ruby function-composition
Gunchars
source share