Sha256: 9b7b73697d89fb478ff85112c0563e69333ca88c195c78265fde1cf071042345

Contents?: true

Size: 428 Bytes

Versions: 14

Compression:

Stored size: 428 Bytes

Contents

require 'csv'

module Squib
  # @api private
  module Args
    class CSV_Opts

      def initialize(opts)
        opts = opts.keep_if { |k, _v| CSV::DEFAULT_OPTIONS.key? k}
        @hash = CSV::DEFAULT_OPTIONS.merge(opts).merge(required)
      end

      def to_hash
        @hash
      end

      private

      def required
        { headers: true, converters: :numeric }
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
squib-0.15.3 lib/squib/args/csv_opts.rb
squib-0.15.0 lib/squib/args/csv_opts.rb
squib-0.14.3.pre1 lib/squib/args/csv_opts.rb
squib-0.14.1 lib/squib/args/csv_opts.rb
squib-0.14.0 lib/squib/args/csv_opts.rb
squib-0.14.beta1 lib/squib/args/csv_opts.rb
squib-0.13.4 lib/squib/args/csv_opts.rb
squib-0.13.3 lib/squib/args/csv_opts.rb
squib-0.13.2 lib/squib/args/csv_opts.rb
squib-0.13.1 lib/squib/args/csv_opts.rb
squib-0.13.0 lib/squib/args/csv_opts.rb
squib-0.12.0 lib/squib/args/csv_opts.rb
squib-0.11.0 lib/squib/args/csv_opts.rb
squib-0.10.0 lib/squib/args/csv_opts.rb