Class: Csvtool::Interface::CLI::Workflows::Presenters::RowRandomizationPresenter
- Inherits:
-
Object
- Object
- Csvtool::Interface::CLI::Workflows::Presenters::RowRandomizationPresenter
- Defined in:
- lib/csvtool/interface/cli/workflows/presenters/row_randomization_presenter.rb
Instance Method Summary collapse
-
#initialize(stdout:, headers:, col_sep:, row_formatter: Output::Formatters::CsvRowFormatter.new) ⇒ RowRandomizationPresenter
constructor
A new instance of RowRandomizationPresenter.
- #print_console_start ⇒ Object
- #print_file_written(path) ⇒ Object
- #print_row(fields) ⇒ Object
Constructor Details
#initialize(stdout:, headers:, col_sep:, row_formatter: Output::Formatters::CsvRowFormatter.new) ⇒ RowRandomizationPresenter
Returns a new instance of RowRandomizationPresenter.
11 12 13 14 15 16 |
# File 'lib/csvtool/interface/cli/workflows/presenters/row_randomization_presenter.rb', line 11 def initialize(stdout:, headers:, col_sep:, row_formatter: Output::Formatters::CsvRowFormatter.new) @stdout = stdout @headers = headers @col_sep = col_sep @row_formatter = row_formatter end |
Instance Method Details
#print_console_start ⇒ Object
18 19 20 21 |
# File 'lib/csvtool/interface/cli/workflows/presenters/row_randomization_presenter.rb', line 18 def print_console_start @stdout.puts @stdout.puts @row_formatter.call(fields: @headers, col_sep: @col_sep) if @headers end |
#print_file_written(path) ⇒ Object
27 28 29 |
# File 'lib/csvtool/interface/cli/workflows/presenters/row_randomization_presenter.rb', line 27 def print_file_written(path) @stdout.puts "Wrote output to #{path}" end |
#print_row(fields) ⇒ Object
23 24 25 |
# File 'lib/csvtool/interface/cli/workflows/presenters/row_randomization_presenter.rb', line 23 def print_row(fields) @stdout.puts @row_formatter.call(fields: fields, col_sep: @col_sep) end |