class IO

Public Instance Methods

ready?() click to toggle source

Return self if the IO object has data ready to read.

# File lib/rubysl/io/wait/wait.rb, line 3
def ready?
  return false if closed?
  return self  if IO.select([self], nil, nil, 0)
end
wait(timeout=nil) click to toggle source

Wait until IO has data to read.

timeout specifies how long to wait for data.

# File lib/rubysl/io/wait/wait.rb, line 11
def wait(timeout=nil)
  return false if closed?
  return self  if IO.select([self], nil, nil, timeout)
end