Module: WindowIO
- Defined in:
- lib/output.rb
Overview
into top level…
Instance Method Summary collapse
-
#getch ⇒ Object
FIXME These don’t/can’t honor @started flag…
-
#gets ⇒ Object
still needs improvement.
- #p(*args) ⇒ Object
- #print(*args) ⇒ Object
- #putch(ch, r: nil, c: nil, fx: nil) ⇒ Object
-
#puts(*args) ⇒ Object
Doesn’t affect STDOUT.puts, etc.
- #rcprint(r, c, *args) ⇒ Object
Instance Method Details
#getch ⇒ Object
FIXME These don’t/can’t honor @started flag…
177 178 179 |
# File 'lib/output.rb', line 177 def getch X.getch end |
#gets ⇒ Object
still needs improvement
181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/output.rb', line 181 def gets # still needs improvement str = "" loop do ch = ::STDSCR.getch if ch == 10 ::STDSCR.crlf break end str << ch end str end |
#p(*args) ⇒ Object
165 166 167 168 |
# File 'lib/output.rb', line 165 def p(*args) recv = RubyText.started ? $stdscr : Kernel recv.p(*args) end |
#print(*args) ⇒ Object
160 161 162 163 |
# File 'lib/output.rb', line 160 def print(*args) recv = RubyText.started ? $stdscr : Kernel recv.print(*args) end |
#putch(ch, r: nil, c: nil, fx: nil) ⇒ Object
194 195 196 197 198 199 |
# File 'lib/output.rb', line 194 def putch(ch, r: nil, c: nil, fx: nil) r, c = STDSCR.rc r ||= r0 c ||= c0 STDSCR.putch(ch, r: r, c: c, fx: fx) end |
#puts(*args) ⇒ Object
Doesn’t affect STDOUT.puts, etc.
155 156 157 158 |
# File 'lib/output.rb', line 155 def puts(*args) # Doesn't affect STDOUT.puts, etc. recv = RubyText.started ? $stdscr : Kernel recv.puts(*args) end |
#rcprint(r, c, *args) ⇒ Object
170 171 172 173 |
# File 'lib/output.rb', line 170 def rcprint(r, c, *args) recv = RubyText.started ? $stdscr : Kernel recv.rcprint r, c, *args end |