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

instance method IO#timeout

timeout -> Numeric | nilRuby 3.2 から[permalink][rdoc][edit]

self に設定されている入出力のタイムアウトを返します。設定されていない場合は nil を返します。

タイムアウトの設定については IO#timeout= を参照してください。

r, w = IO.pipe
p r.timeout      # => nil
r.timeout = 0.5
p r.timeout      # => 0.5

[SEE_ALSO] IO#timeout=