csv
csv copied to clipboard
issue-85: Encode headers as Keyword list
This PR addresses Encode headers as Keyword list #85
CSV.encode accepts a Keyword list as headers, the keys of that list will be used as the keys for the rows, but the value will be the value used for the header row name in CSV output.
[%{a: "value!"}] |> CSV.encode(headers: [a: "x", b: "y"])
# ["x,y\\r\\n", "value!,\\r\\n"]
Checklist
- Tests added - Yes
- Coverage increases or stays the same - Yes
- Docs updated - updated Readme.md
- Changelog updated - No release from this PR
Coverage remained the same at 100.0% when pulling dd1ffad608e8b1642fa05d449c9135c657088342 on michaelchu:keyword-list into ff96571e54cc57fb9ff8523a3c203614c114f4f7 on beatrichartz:master.
Merged, thanks for this