Class: Csv2Psql::CsvHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/csv2psql/helpers/csv_helper.rb

Overview

CSV Helper

Constant Summary collapse

BASE_DIR =
File.join(File.dirname(__FILE__), '..')

Class Method Summary collapse

Class Method Details

.get_header(row, opts = {}) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/csv2psql/helpers/csv_helper.rb', line 12

def get_header(row, opts = {})
  if opts[:header]
    row.headers
  else
    row.map.with_index { |_item, i| i }
  end
end