5 ms·
If I understand the Ruby pipeline operator it's essentially an alias of the dot. The example in the feature tracker is: ``` 1.. |> take 10 |> map {|e| e2} |>
by leifg 5y ago
If I understand the Ruby pipeline operator it's essentially an alias of the dot. The example in the feature tracker is:
```
1.. |> take 10 |> map {|e| e2} |> (x)
```
which is equivalent to
```
(1...).take(10).map{|e| e2}
```
So in order to use it you still need extensions on every single object. The only reason that looks nice is because in this example you continuously call methods on lists that return a list. You can't add `my_custom_list_operation(list_input)` in between.