Class: Csvtool::Infrastructure::Output::ConsoleWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/csvtool/infrastructure/output/console_writer.rb

Instance Method Summary collapse

Constructor Details

#initialize(stdout:, value_streamer:) ⇒ ConsoleWriter

Returns a new instance of ConsoleWriter.



7
8
9
10
# File 'lib/csvtool/infrastructure/output/console_writer.rb', line 7

def initialize(stdout:, value_streamer:)
  @stdout = stdout
  @value_streamer = value_streamer
end

Instance Method Details

#call(file_path:, column_name:, col_sep:, skip_blanks:) ⇒ Object



12
13
14
15
16
# File 'lib/csvtool/infrastructure/output/console_writer.rb', line 12

def call(file_path:, column_name:, col_sep:, skip_blanks:)
  @value_streamer.each(file_path: file_path, column_name: column_name, col_sep: col_sep, skip_blanks: skip_blanks) do |value|
    @stdout.puts value
  end
end