Class: Csvtool::Interface::CLI::Workflows::RunCsvParityWorkflow
- Inherits:
-
Object
- Object
- Csvtool::Interface::CLI::Workflows::RunCsvParityWorkflow
- Defined in:
- lib/csvtool/interface/cli/workflows/run_csv_parity_workflow.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(stdin:, stdout:, stderr: stdout, use_case: Application::UseCases::RunCsvParity.new) ⇒ RunCsvParityWorkflow
constructor
A new instance of RunCsvParityWorkflow.
Constructor Details
#initialize(stdin:, stdout:, stderr: stdout, use_case: Application::UseCases::RunCsvParity.new) ⇒ RunCsvParityWorkflow
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/csvtool/interface/cli/workflows/run_csv_parity_workflow.rb', line 21 def initialize(stdin:, stdout:, stderr: stdout, use_case: Application::UseCases::RunCsvParity.new) @stdin = stdin @stdout = stdout @stderr = stderr @use_case = use_case @errors = Interface::CLI::Errors::Presenter.new(stdout: @stderr) @session_builder = Builders::CsvParitySessionBuilder.new @presenter = Presenters::CsvParityPresenter.new(stdout: stdout) @result_error_handler = Support::ResultErrorHandler.new(errors: @errors) end |
Instance Method Details
#call ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/csvtool/interface/cli/workflows/run_csv_parity_workflow.rb', line 32 def call context = { use_case: @use_case, session_builder: @session_builder, presenter: @presenter, handle_error: method(:handle_error) } pipeline = Steps::WorkflowStepPipeline.new(steps: [ Steps::Parity::CollectInputsStep.new( file_path_prompt: Interface::CLI::Prompts::FilePathPrompt.new(stdin: @stdin, stdout: @stderr), separator_prompt: Interface::CLI::Prompts::SeparatorPrompt.new(stdin: @stdin, stdout: @stderr, errors: @errors), headers_present_prompt: Interface::CLI::Prompts::HeadersPresentPrompt.new(stdin: @stdin, stdout: @stderr) ), Steps::Parity::BuildSessionStep.new, Steps::Parity::ExecuteStep.new ]) pipeline.call(context) nil end |