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'