Class: Csv2Psql::Frontend::Csv

Inherits:
Base
  • Object
show all
Defined in:
lib/csv2psql/frontend/csv.rb

Overview

Csv frontend class

Instance Method Summary collapse

Instance Method Details

#open(path, open_opts = 'rt', csv_opts = {}, &_block) ⇒ Object



12
13
14
15
16
# File 'lib/csv2psql/frontend/csv.rb', line 12

def open(path, open_opts = 'rt', csv_opts = {}, &_block)
  CSV.open(path, open_opts, csv_opts.merge(:col_sep => csv_opts[:delimiter] || csv_opts[:col_sep] || ',')) do |csv|
    Proc.new.call(csv)
  end
end