Sha256: a082d717e521bdec260ecb1145db8932b1dbe7583f59ef7f1bcf2002c6e14ed5

Contents?: true

Size: 632 Bytes

Versions: 20

Compression:

Stored size: 632 Bytes

Contents

require 'csv'
module Eco
  class CSV < ::CSV
    class << self
      include Eco::Data::Files

      # @return [Eco::CSV::Table]
      def parse(data, **kargs, &block)
        kargs = {headers: true, skip_blanks: true}.merge(kargs)
        Eco::CSV::Table.new(super(data, **kargs, &block))
      end

      # @return [Eco::CSV::Table]
      def read(file, **kargs)
        params = {}.tap do |prms|
          prms.merge!(encoding: kargs.delete(:encoding)) if kargs.key?(:encoding)
        end
        parse(get_file_content(file, **params), **kargs)
      end
    end
  end
end

require_relative 'csv/table'

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
eco-helpers-2.7.12 lib/eco/csv.rb
eco-helpers-2.7.4 lib/eco/csv.rb
eco-helpers-2.7.2 lib/eco/csv.rb
eco-helpers-2.7.1 lib/eco/csv.rb
eco-helpers-2.7.0 lib/eco/csv.rb
eco-helpers-2.6.4 lib/eco/csv.rb
eco-helpers-2.6.3 lib/eco/csv.rb
eco-helpers-2.6.2 lib/eco/csv.rb
eco-helpers-2.6.1 lib/eco/csv.rb
eco-helpers-2.6.0 lib/eco/csv.rb
eco-helpers-2.5.10 lib/eco/csv.rb
eco-helpers-2.5.9 lib/eco/csv.rb
eco-helpers-2.5.8 lib/eco/csv.rb
eco-helpers-2.5.7 lib/eco/csv.rb
eco-helpers-2.5.6 lib/eco/csv.rb
eco-helpers-2.5.5 lib/eco/csv.rb
eco-helpers-2.5.4 lib/eco/csv.rb
eco-helpers-2.5.3 lib/eco/csv.rb
eco-helpers-2.5.2 lib/eco/csv.rb
eco-helpers-2.5.1 lib/eco/csv.rb