Created
June 24, 2019 02:30
-
-
Save gongo/cb8f63fa258f513acaa93ff9be6047fb to your computer and use it in GitHub Desktop.
ヘッダが異なる CSV::Row を混ぜていい感じに csv 作りたい
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
row1 = CSV::Row.new(['a', 'b'], [1, 2]) | |
row2 = CSV::Row.new(['a', 'c'], [4, 12]) | |
table = CSV::Table.new([row1, row2]) | |
table.to_s | |
# | |
# expected: | |
# | |
# a,b,c | |
# 1,2, | |
# 4,,12 | |
# | |
# actual: | |
# | |
# a,b | |
# 1,2 | |
# 4,12 | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment