Object
RD::Part is a pseudo IO class
# File lib/rd/filter.rb, line 195 def << (arg) begin @content << arg.to_s self rescue raise IOError end end
# File lib/rd/filter.rb, line 92 def each_byte while char = getc yield(char) end end
# File lib/rd/filter.rb, line 85 def each_line(rs = $/) while line = gets yield(line) end end
# File lib/rd/filter.rb, line 98 def eof? @pos == @content.size end
# File lib/rd/filter.rb, line 152 def gets(rs = $/) get_line(nil, rs) end
# File lib/rd/filter.rb, line 204 def print(*args) begin args.each do |i| @content << i.to_s end nil rescue raise IOError end end
# File lib/rd/filter.rb, line 215 def printf(format, *args) str = sprintf(format, *args) begin @content << str nil rescue raise IOError end end
# File lib/rd/filter.rb, line 225 def putc(char) self.printf("%c", char) char end
# File lib/rd/filter.rb, line 230 def puts(*args) args.flatten.each do |i| self.print(i, "\n") end end
# File lib/rd/filter.rb, line 160 def read(length = @content.size - @pos) ret = "" length.times do ret << getc end ret end
# File lib/rd/filter.rb, line 156 def readline(rs = $/) get_line(true, $/) end
# File lib/rd/filter.rb, line 168 def readlines(rs = $/) ret = [] each_line(rs) do |line| ret.push(line) end ret end
# File lib/rd/filter.rb, line 180 def seek(offset, whence) case whence when 0 @pos = offset when 1 @pos += offset when 2 @pos += @content.size - 1 else raise Errno::EINVAL end end
Generated with the Darkfish Rdoc Generator 2.