Class: Spark::Command::FlatMap
Overview
FlatMap
Instance Method Summary collapse
Instance Method Details
#lazy_run(iterator) ⇒ Object
33 34 35 36 37 |
# File 'lib/spark/command/basic.rb', line 33 def lazy_run(iterator, *) iterator.flat_map do |item| @map_function.call(item) end end |
#run(iterator) ⇒ Object
27 28 29 30 31 |
# File 'lib/spark/command/basic.rb', line 27 def run(iterator, *) iterator = super iterator.flatten!(1) iterator end |