@@ -3,17 +3,22 @@ class IO
33 # <!--
44 # rdoc-file=io.c
55 # - io.wait(events, timeout) -> event mask, false or nil
6- # - io.wait(timeout = nil, mode = :read ) -> self, true, or false
6+ # - io.wait(*event_symbols[, timeout] ) -> self, true, or false
77 # -->
88 # Waits until the IO becomes ready for the specified events and returns the
99 # subset of events that become ready, or a falsy value when times out.
1010 #
1111 # The events can be a bit mask of `IO::READABLE`, `IO::WRITABLE` or
1212 # `IO::PRIORITY`.
1313 #
14- # Returns a truthy value immediately when buffered data is available.
14+ # Returns an event mask (truthy value) immediately when buffered data is
15+ # available.
1516 #
16- # Optional parameter `mode` is one of `:read`, `:write`, or `:read_write`.
17+ # The second form: if one or more event symbols (`:read`, `:write`, or
18+ # `:read_write`) are passed, the event mask is the bit OR of the bitmask
19+ # corresponding to those symbols. In this form, `timeout` is optional, the
20+ # order of the arguments is arbitrary, and returns `io` if any of the events is
21+ # ready.
1722 #
1823 def wait : (Integer events, ?Time::_Timeout timeout) -> (Integer | false | nil )
1924 | (?Time::_Timeout? timeout, *wait_mode mode) -> (self | true | false)
0 commit comments