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

instance method Psych::SyntaxError#context

context -> StringRuby 1.9.3 から[permalink][rdoc][edit]

エラーが生じたコンテキストを文字列で返します。