Sha256: 3ef07a6e3d80443838a72083c4121bc0b07f9fe62b64894dde3fc42583e2866a

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

module RowBoat
  # @api private
  module Helpers
    CSV_OPTION_KEYS = %i[
      chunk_size
      col_sep
      comment_regexp
      convert_values_to_numeric
      downcase_header
      file_encoding
      force_simple_split
      force_utf8
      headers_in_file
      invalid_byte_sequence
      keep_original_headers
      key_mapping
      quote_char
      remove_empty_hashes
      remove_empty_values
      remove_unmapped_keys
      remove_values_matching
      remove_zero_values
      row_sep
      skip_lines
      strings_as_keys
      strip_chars_from_headers
      strip_whitespace
      user_provided_headers
      value_converters
      verbose
    ].freeze

    IMPORT_OPTION_KEYS = %i[
      batch_size
      ignore
      on_duplicate_key_ignore
      recursive
      synchronize
      timestamps
      validate
    ].freeze

    class << self
      def extract_csv_options(options)
        options.slice(*CSV_OPTION_KEYS)
      end

      def extract_import_options(options)
        options.slice(*IMPORT_OPTION_KEYS)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
row_boat-0.5.0 lib/row_boat/helpers.rb
row_boat-0.4.0 lib/row_boat/helpers.rb
row_boat-0.3.0 lib/row_boat/helpers.rb
row_boat-0.2.0 lib/row_boat/helpers.rb
row_boat-0.1.0 lib/row_boat/helpers.rb