Class: Gamefic::Cgi::UserStream
- Inherits:
-
UserStream
- Object
- UserStream
- Gamefic::Cgi::UserStream
- Defined in:
- lib/gamefic/engine/cgi.rb
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize ⇒ UserStream
constructor
A new instance of UserStream.
- #select(prompt) ⇒ Object
- #send(data) ⇒ Object
Methods inherited from UserStream
Constructor Details
#initialize ⇒ UserStream
Returns a new instance of UserStream.
197 198 199 200 |
# File 'lib/gamefic/engine/cgi.rb', line 197 def initialize super @output = '' end |
Instance Method Details
#flush ⇒ Object
201 202 203 204 205 |
# File 'lib/gamefic/engine/cgi.rb', line 201 def flush buffer = "#{@output}" @output.clear buffer end |
#select(prompt) ⇒ Object
212 213 214 215 216 |
# File 'lib/gamefic/engine/cgi.rb', line 212 def select(prompt) # TODO: non-blocking read line = STDIN.gets @queue.push line end |
#send(data) ⇒ Object
206 207 208 209 210 211 |
# File 'lib/gamefic/engine/cgi.rb', line 206 def send(data) #if data.start_with?(Ansi::NEL) # data = "<p>#{data[Ansi::NEL.length..-1].rstrip}</p>" #end @output = "#{@output}#{data}" end |