Module: SmarterCSV::Options
- Included in:
- Reader
- Defined in:
- lib/smarter_csv/options.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ acceleration: true, # if user wants to use accelleration or not auto_row_sep_chars: 500, chunk_size: nil, col_sep: :auto, # was: ',', comment_regexp: nil, # was: /\A#/, convert_values_to_numeric: true, downcase_header: true, duplicate_header_suffix: '', # was: nil, file_encoding: 'utf-8', force_simple_split: false, force_utf8: false, headers_in_file: true, invalid_byte_sequence: '', keep_original_headers: false, key_mapping: nil, quote_char: '"', remove_empty_hashes: true, remove_empty_values: true, remove_unmapped_keys: false, remove_values_matching: nil, remove_zero_values: false, required_headers: nil, required_keys: nil, row_sep: :auto, # was: $/, silence_missing_keys: false, skip_lines: nil, strings_as_keys: false, strip_chars_from_headers: nil, strip_whitespace: true, user_provided_headers: nil, value_converters: nil, verbose: false, with_line_numbers: false, }.freeze
Instance Method Summary collapse
-
#process_options(given_options = {}) ⇒ Object
NOTE: this is not called when “parse” methods are tested by themselves.
Instance Method Details
#process_options(given_options = {}) ⇒ Object
NOTE: this is not called when “parse” methods are tested by themselves
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/smarter_csv/options.rb', line 50 def ( = {}) puts "User provided options:\n#{pp()}\n" if [:verbose] @options = DEFAULT_OPTIONS.dup.merge!() # fix invalid input @options[:invalid_byte_sequence] ||= '' puts "Computed options:\n#{pp(@options)}\n" if @options[:verbose] (@options) @options end |