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