rewind

ARGF.rewind â 0 Instance Public methods Positions the current file to the beginning of input, resetting ARGF.lineno to zero. ARGF.readline #=> "This is line one\n" ARGF.rewind #=> 0 ARGF.lineno #=> 0 ARGF.readline #=> "This is line one\n"

seek

ARGF.seek(amount, whence=IO::SEEK_SET) â 0 Instance Public methods Seeks to offset amount (an Integer) in the ARGF stream according to the value of whence. See +IO#seek+ for further details.

set_encoding

ARGF.set_encoding(ext_enc) â ARGFARGF.set_encoding("ext_enc:int_enc") â ARGFARGF.set_encoding(ext_enc, int_enc) â ARGFARGF.set_encoding("ext_enc:int_enc", opt) â ARGFARGF.set_encoding(ext_enc, int_enc, opt) â ARGF Instance Public methods If single argument is specified, strings read from ARGF are tagged with the encoding specified. If two encoding names separated by a colon are given, e.g. âascii:utf-8â, the read string is converted from the first encodi

skip

ARGF.skip â ARGF Instance Public methods Sets the current file to the next file in ARGV. If there aren't any more files it has no effect. For example: $ ruby argf.rb foo bar ARGF.filename #=> "foo" ARGF.skip ARGF.filename #=> "bar"

tell

ARGF.tell â Integer Instance Public methods Returns the current offset (in bytes) of the current file in ARGF. ARGF.pos #=> 0 ARGF.gets #=> "This is line one\n" ARGF.pos #=> 17

to_a

ARGF.to_a(sep=$/) â arrayARGF.to_a(limit) â arrayARGF.to_a(sep, limit) â array Instance Public methods Reads ARGF's current file in its entirety, returning an Array of its lines, one line per element. Lines are assumed to be separated by sep. lines = ARGF.readlines lines[0] #=> "This is line one\n"

to_i

ARGF.to_i â fixnum Instance Public methods Returns an integer representing the numeric file descriptor for the current file. Raises an ArgumentError if there isn't a current file. ARGF.fileno #=> 3

to_io

ARGF.to_io â IO Instance Public methods Returns an IO object representing the current file. This will be a File object unless the current file is a stream such as STDIN. For example: ARGF.to_io #=> #<File:glark.txt> ARGF.to_io #=> #<IO:<STDIN>>

to_s

ARGF.to_s â String Instance Public methods Returns âARGFâ. inspect

to_write_io

ARGF.to_write_io â io Instance Public methods Returns IO instance tied to ARGF for writing if inplace mode is enabled.