Ruby 3.4 リファレンスマニュアル

instance method NilClass#to_h

to_h -> {}Ruby 2.0.0 から[permalink][rdoc][edit]

{} を返します。

p nil.to_h #=> {}