Conditions | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | require "csv" |
||
14 | def parse(contents, &block) |
||
15 | mapped = [] |
||
16 | CSV.parse(contents, parser_options) do |row| |
||
17 | new_row = {} |
||
18 | row.each_with_index do |value, index| |
||
19 | new_row[column_name(index)] = value |
||
20 | end |
||
21 | mapped << new_row |
||
22 | end |
||
23 | block_given? ? mapped.each(&block) : mapped |
||
24 | end |
||
25 | |||
34 |