Ruby 3.1 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > NilClassクラス > to_a
to_a -> Array
空配列 [] を返します。
p nil.to_a # => []