class Fech::Csv
Ruby 1.9 and up compatibility
1.8 compatibility
Public Class Methods
clean_opts(opts)
click to toggle source
# File lib/fech/csv.rb, line 30 def self.clean_opts(opts) opts.reject {|k,v| ![:col_sep, :quote_char, :encoding].include?(k)} end
parse_row(file_path, opts) { |row| ... }
click to toggle source
Loads a given file and parses it into an array, line by line. Basic wrapper around FasterCSV.foreach @param [String] file_path location of the filing on the file system @options opts passed through to FasterCSV
# File lib/fech/csv.rb, line 26 def self.parse_row(file_path, opts) foreach(file_path, clean_opts(opts)) { |row| yield row } end