putc

ios.putc(obj) â obj Instance Public methods If obj is Numeric, write the character whose code is the least-significant byte of obj, otherwise write the first byte of the string representation of obj to ios. Note: This method is not safe for use with multi-byte characters as it will truncate them. $stdout.putc "A" $stdout.putc 65 produces: AA

printf

ios.printf(format_string [, obj, ...]) â nil Instance Public methods Formats and writes to ios, converting parameters under control of the format string. See Kernel#sprintf for details.

print

ios.print() â nilios.print(obj, ...) â nil Instance Public methods Writes the given object(s) to ios. The stream must be opened for writing. If the output field separator ($,) is not nil, it will be inserted between each object. If the output record separator ($\) is not nil, it will be appended to the output. If no arguments are given, prints $_. Objects that aren't strings will be converted by calling their to_s method. With no argument, prints the contents of th

pos=

ARGF.pos = position â Integer Instance Public methods Seeks to the position given by position (in bytes) in ARGF. For example: ARGF.pos = 17 ARGF.gets #=> "This is line two\n"

pos

ARGF.pos â 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

path

ARGF.path â String Instance Public methods Returns the current filename. â-â is returned when the current file is STDIN. For example: $ echo "foo" > foo $ echo "bar" > bar $ echo "glark" > glark $ ruby argf.rb foo bar glark ARGF.filename #=> "foo" ARGF.read(5) #=> "foo\nb" ARGF.filename #=> "bar" ARGF.skip ARGF.filename #=> "glark"

lines

lines(*args) Instance Public methods This is a deprecated alias for each_line.

lineno=

ARGF.lineno = integer â integer Instance Public methods Sets the line number of ARGF as a whole to the given Integer. ARGF sets the line number automatically as you read data, so normally you will not need to set it explicitly. To access the current line number use ARGF.lineno. For example: ARGF.lineno #=> 0 ARGF.readline #=> "This is line 1\n" ARGF.lineno #=> 1 ARGF.lineno = 0 #=> 0 ARGF.lineno #=> 0

lineno

ARGF.lineno â integer Instance Public methods Returns the current line number of ARGF as a whole. This value can be set manually with ARGF.lineno=. For example: ARGF.lineno #=> 0 ARGF.readline #=> "This is line 1\n" ARGF.lineno #=> 1

internal_encoding

ARGF.internal_encoding â encoding Instance Public methods Returns the internal encoding for strings read from ARGF as an Encoding object. If ARGF.set_encoding has been called with two encoding names, the second is returned. Otherwise, if Encoding.default_external has been set, that value is returned. Failing that, if a default external encoding was specified on the command-line, that value is used. If the encoding is unknown, nil is returned.