Sha256: 59d7ee395cbedc4c9a059fa5d477d5e634dc228cf59b7353a0ea81031366acde

Contents?: true

Size: 358 Bytes

Versions: 3

Compression:

Stored size: 358 Bytes

Contents

module BSFlow
  class Combine
    def initialize(combine_proc:, sub_procs:)
      @sub_procs = sub_procs
      @combine_proc = combine_proc
    end
    
    def call(*args)
      sub_proc_outputs = []
      @sub_procs.each do |sub_proc|
        sub_proc_outputs << sub_proc.call(*args)
      end
      @combine_proc.call(*sub_proc_outputs)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bsflow-2.4.0 lib/bsflow/combine.rb
bsflow-2.3.0 lib/bsflow/combine.rb
bsflow-2.2.0 lib/bsflow/combine.rb