Sha256: a93f6d1213ae58e72bb94579f0e99fd7ff2daf92c9cb16fd1cdb2542df8fd3b7
Contents?: true
Size: 624 Bytes
Versions: 17
Compression:
Stored size: 624 Bytes
Contents
module Stages class Each < Stage def initialize(things = nil, &block) @things = things unless things.nil? @block = block super() end def process if @things process_things else process_inputs end end def process_inputs while v = input v = @block.call(v) if @block v.each do |v| output v end end end def process_things @things = @block.call(@things) if @block output nil if @things.nil? @things.each do |thing| output thing end end end end
Version data entries
17 entries across 17 versions & 1 rubygems