require 'csv'
csv_strings = CSV.generate { |csv| csv << ['A', 'B']; csv << ['C', 'D'] }
# => "A,B\nC,D\n"
CSV.new(csv_strings)
# => <#CSV io_type:StringIO encoding:ASCII-8BIT lineno:0 col_sep:"," row_sep:"\n" quote_char:"\"">
CSV.new(csv_strings).read
# => [["A", "B"], ["C", "D"]]
Ref
Class: CSV (Ruby 2.6.1)
https://ruby-doc.org/stdlib-2.6.1/libdoc/csv/rdoc/CSV.html
Original by Github issue
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。