Ruby 2.5.0 リファレンスマニュアル > ライブラリ一覧 > pathnameライブラリ > Pathnameクラス > write
write(string, offset=nil, **opts) -> Integer
IO.write(self.to_s, string, offset, **opts)と同じです。
[SEE_ALSO] IO.write