Sha256: 19bdf406a83340c9d1c1c97797e3b17485b522dfab4bae190280952332f0138d

Contents?: true

Size: 529 Bytes

Versions: 9

Compression:

Stored size: 529 Bytes

Contents

# frozen_string_literal: true

require "csv"

module Decidim
  module TermCustomizer
    module Import
      module Readers
        # Imports any exported CSV file to local objects. It transforms the
        # import data using the parser into the final target objects.
        class CSV < Base
          MIME_TYPE = "text/csv"

          def read_rows
            ::CSV.read(file, col_sep: ";").each_with_index do |row, index|
              yield row, index
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
decidim-term_customizer-0.23.0 lib/decidim/term_customizer/import/readers/csv.rb
decidim-term_customizer-0.22.0 lib/decidim/term_customizer/import/readers/csv.rb
decidim-term_customizer-0.21.0 lib/decidim/term_customizer/import/readers/csv.rb
decidim-term_customizer-0.20.0 lib/decidim/term_customizer/import/readers/csv.rb
decidim-term_customizer-0.19.1 lib/decidim/term_customizer/import/readers/csv.rb
decidim-term_customizer-0.19.0 lib/decidim/term_customizer/import/readers/csv.rb
decidim-term_customizer-0.18.0 lib/decidim/term_customizer/import/readers/csv.rb
decidim-term_customizer-0.17.1 lib/decidim/term_customizer/import/readers/csv.rb
decidim-term_customizer-0.17.0 lib/decidim/term_customizer/import/readers/csv.rb