Class: HotCell::Fixtures::Concatenate

Inherits:
Operation
  • Object
show all
Defined in:
lib/hot_cell/test_operations.rb

Overview

Two inputs, one output, so the request shape with several inputs is covered.

Constant Summary

Constants inherited from Operation

Operation::READ_BYTES

Instance Method Summary collapse

Methods inherited from Operation

abstract_operation, abstract_operation?, before_fork, before_worker_boot, inherited, limits, operation, operation_name, #run_tool, unreadable

Instance Method Details

#perform(inputs, outputs, separator: "") ⇒ Object



34
35
36
37
38
39
# File 'lib/hot_cell/test_operations.rb', line 34

def perform(inputs, outputs, separator: "")
  destination, = outputs
  File.binwrite destination.path, inputs.map { |input| File.binread(input.path) }.join(separator.to_s)

  { inputs: inputs.size }
end