rewind

ios.rewind รข 0
Instance Public methods

Positions ios to the beginning of input, resetting lineno to zero.

f = File.new("testfile")
f.readline   #=> "This is line one\n"
f.rewind     #=> 0
f.lineno     #=> 0
f.readline   #=> "This is line one\n"

Note that it cannot be used with streams such as pipes, ttys, and sockets.

doc_ruby_on_rails
2015-04-13 14:01:44
Comments
Leave a Comment

Please login to continue.