thbar/kiba

Allow to decorate sources to normalize rows

thbar opened this issue · 2 comments

thbar commented

Since #4 is harder than I first expected, I could still provide reusable normalization right after the source, quite easily. Potential syntax:

source Kiba::Normalizer, CsvSource, 'input.csv' do |row|
  tags = row.delete(:tags).split(',')
  tags.each { |tag| yield(row.deep_copy.merge(tag: tag) }
end

This is less powerful than #4, but will still cover most of the cases.

thbar commented

Documented here.

thbar commented

Closing since this is documented now.