Class: A4Tools::StandardOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/net_shell/io.rb

Direct Known Subclasses

FileOverwriteOutput

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#colorObject

Returns the value of attribute color.



13
14
15
# File 'lib/net_shell/io.rb', line 13

def color
  @color
end

Instance Method Details

#closeObject



20
21
# File 'lib/net_shell/io.rb', line 20

def close
end


23
24
25
# File 'lib/net_shell/io.rb', line 23

def print(s="")
  write s.to_s
end

#puts(s = "") ⇒ Object



27
28
29
# File 'lib/net_shell/io.rb', line 27

def puts(s="")
  write s.to_s+"\n"
end

#write(s) ⇒ Object



15
16
17
18
# File 'lib/net_shell/io.rb', line 15

def write(s)
  s = s.unstyle unless @color
  $stdout.write s.gsub("\t", "  ").gsub("\n","\r\n")
end