Class: Marktable::Tables::CSV

Inherits:
Object
  • Object
show all
Defined in:
lib/marktable/tables/csv.rb

Instance Method Summary collapse

Constructor Details

#initialize(csv_data, headers) ⇒ CSV

Returns a new instance of CSV.



9
10
11
12
# File 'lib/marktable/tables/csv.rb', line 9

def initialize(csv_data, headers)
  @csv_data = csv_data
  @headers_flag = headers
end

Instance Method Details

#parseObject



14
15
16
17
18
19
20
21
22
# File 'lib/marktable/tables/csv.rb', line 14

def parse
  csv_table = parse_csv

  if with_headers?
    parse_with_headers(csv_table)
  else
    parse_without_headers(csv_table)
  end
end