eof?

ARGF.eof? â true or false
Instance Public methods

Returns true if the current file in ARGF is at end of file, i.e. it has no data to read. The stream must be opened for reading or an IOError will be raised.

$ echo "eof" | ruby argf.rb

ARGF.eof?                 #=> false
3.times { ARGF.readchar }
ARGF.eof?                 #=> false
ARGF.readchar             #=> "\n"
ARGF.eof?                 #=> true
doc_ruby_on_rails
2015-03-30 11:15:16
Comments
Leave a Comment

Please login to continue.