pandazx's blog

データ分析など雑多な技術ブログ

JSONファイルを1行で読込む

data = JSON.parse(File.read(filepath))
# または
File.open(filepath){|io| JSON.load(io) }