Class: IO

Inherits:
Object
  • Object
show all
Defined in:
lib/fugit/io_get_line.rb

Instance Method Summary collapse

Instance Method Details

#get_lineObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/fugit/io_get_line.rb', line 3

def get_line
	line = nil
	ending = nil
	while c = self.read(1)
		line ||= ""
		line << c
		if c == "\r" || c == "\n"
			break
		end
	end
	line
end