Ruby csv

From wikinotes
csv = CSV.new(File.read('out.csv'))
csv.read          # array of rows
csv << [0, 1, 2]  # append row to csv


csv = CSV.new(<<~CSV, headers: true)
id, name
123, foouser
456, baruser
CSV
# each time you call `csv.first`, it returns the next row
csv.first # {id: 123, name: "foouser" }
csv.first # {id: 456, name: "baruser" }