Method: RubyText::Window#screen_text

Defined in:
lib/window.rb

#screen_text(file = nil) ⇒ Object

rename?



111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/window.rb', line 111

def screen_text(file = nil)   # rename?
  lines = []
  0.upto(self.rows-1) do |r|
    line = ""
    0.upto(self.cols-1) do |c|
      line << self[r, c]
    end
    lines << line
  end
  File.open(file, "w") {|f| f.puts lines }  if file
  lines
end