DEV Community

Discussion on: Ruby already has pipeline functionality

Collapse
 
rhymes profile image
rhymes

The feature that Johan Wentholt is using is called functional composition, and ruby 2.6 shipped with 2 operators for it. <<, for a(b()), and >> for b(a()). These operators allow you to compose procs out of existing procs

Totally didn't know!! This is so cool :) A bit obscure in its syntax but cool.

I would have added just one, >>, you can just change the order of the listed procs if you need to. Or maybe I'm missing something