Module: WindowIO
- Defined in:
- lib/output.rb
Overview
into top level…
Instance Method Summary collapse
- #getch ⇒ Object
-
#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
162 163 164 |
# File 'lib/output.rb', line 162 def getch X.getch end |
#gets ⇒ Object
still needs improvement
166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/output.rb', line 166 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
154 155 156 |
# File 'lib/output.rb', line 154 def p(*args) $stdscr.p(*args) end |
#print(*args) ⇒ Object
150 151 152 |
# File 'lib/output.rb', line 150 def print(*args) $stdscr.print(*args) end |
#putch(ch, r: nil, c: nil, fx: nil) ⇒ Object
179 180 181 |
# File 'lib/output.rb', line 179 def putch(ch, r: nil, c: nil, fx: nil) $stdscr.putch(ch, r: r, c: c, fx: fx) end |
#puts(*args) ⇒ Object
Doesn’t affect STDOUT.puts, etc.
146 147 148 |
# File 'lib/output.rb', line 146 def puts(*args) # Doesn't affect STDOUT.puts, etc. $stdscr.puts(*args) end |
#rcprint(r, c, *args) ⇒ Object
158 159 160 |
# File 'lib/output.rb', line 158 def rcprint(r, c, *args) $stdscr.rcprint r, c, *args end |