10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/csvtool/interface/cli/workflows/steps/csv_split/execute_step.rb', line 10
def call(context)
= context.fetch(:use_case).(
file_path: context.fetch(:file_path),
col_sep: context.fetch(:col_sep),
headers_present: context.fetch(:headers_present)
)
unless .ok?
context.fetch(:handle_error).call()
return :halt
end
result = context.fetch(:use_case).call(session: context.fetch(:session))
unless result.ok?
context.fetch(:handle_error).call(result)
return :halt
end
context.fetch(:presenter).print_summary(result.data.merge(chunk_size: context.fetch(:chunk_size)))
nil
end
|