class A4Tools::PipeBuffer
Attributes
buffer[R]
color[RW]
Public Class Methods
new()
click to toggle source
# File lib/net_shell/io.rb, line 36 def initialize @buffer = "" end
Public Instance Methods
close()
click to toggle source
# File lib/net_shell/io.rb, line 68 def close end
print(s="")
click to toggle source
# File lib/net_shell/io.rb, line 64 def print(s="") write(s.to_s) end
printf(s, *a)
click to toggle source
# File lib/net_shell/io.rb, line 60 def printf(s, *a) write(sprintf(s.to_s, *a)) end
puts(s)
click to toggle source
# File lib/net_shell/io.rb, line 52 def puts(s) if s.is_a? Array then s.each { |e| puts e.to_s } else write(s.to_s+"\n") end end
read()
click to toggle source
# File lib/net_shell/io.rb, line 40 def read @color ? @buffer : @buffer.unstyle end
read_all()
click to toggle source
# File lib/net_shell/io.rb, line 44 def read_all @color ? @buffer : @buffer.unstyle end
write(s)
click to toggle source
# File lib/net_shell/io.rb, line 48 def write(s) @buffer += s end