collect
for filters
Collect the stream and pass it to a block.
Signature
> collect (closure) --keep-env
Parameters
closure
: the closure to run once the stream is collected--keep-env
(-)
: let the block affect environment variables
Examples
Use the second value in the stream
> [1 2 3] | collect { |x| $x.1 }
2