Class: Csvtool::Infrastructure::CSV::ValueStreamer
- Inherits:
-
Object
- Object
- Csvtool::Infrastructure::CSV::ValueStreamer
- Defined in:
- lib/csvtool/infrastructure/csv/value_streamer.rb
Instance Method Summary collapse
Instance Method Details
#each(file_path:, column_name:, col_sep:, skip_blanks:) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/csvtool/infrastructure/csv/value_streamer.rb', line 9 def each(file_path:, column_name:, col_sep:, skip_blanks:) ::CSV.foreach(file_path, headers: true, col_sep: col_sep) do |row| value = row[column_name].to_s next if skip_blanks && value.strip.empty? yield value end end |