Sha256: 7d9b00e7709a1ecf2acfa3e4456873f7706b86f5e7b89f003b9f892e81d8bd30

Contents?: true

Size: 357 Bytes

Versions: 1

Compression:

Stored size: 357 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bsielski_control_flow-1.0.0 lib/c_flow/combine.rb