Ruby snippets

Read CSV to a hash

filepath = "path/to/file.csv"
data = CSV.read(filepath, headers: true).map(&:to_h)