method

gets

v1_9_1_378 - Show latest stable - Class: Buffering
gets(eol=$/, limit=nil)
public

No documentation available.

# File ext/openssl/lib/openssl/buffering.rb, line 102
  def gets(eol=$/, limit=nil)
    idx = @rbuffer.index(eol)
    until @eof
      break if idx
      fill_rbuff
      idx = @rbuffer.index(eol)
    end
    if eol.is_a?(Regexp)
      size = idx ? idx+$&.size : nil
    else
      size = idx ? idx+eol.size : nil
    end
    if limit and limit >= 0
      size = [size, limit].min
    end
    consume_rbuff(size)
  end