class ToucanCLI::Application
Public Class Methods
new()
click to toggle source
# File lib/toucan_cli/application.rb, line 3 def initialize @screen = Screen.new end
Public Instance Methods
clear()
click to toggle source
# File lib/toucan_cli/application.rb, line 33 def clear @screen.owin.clear refresh end
inputs() { |input| ... }
click to toggle source
# File lib/toucan_cli/application.rb, line 7 def inputs Thread.new do loop do input = @screen.iqueue.pop next unless input yield(input) refresh end end end
outputs() { || ... }
click to toggle source
# File lib/toucan_cli/application.rb, line 19 def outputs @screen.start do yield end end
outputs_loop() { || ... }
click to toggle source
# File lib/toucan_cli/application.rb, line 25 def outputs_loop @screen.start do loop do yield end end end
print(string)
click to toggle source
# File lib/toucan_cli/application.rb, line 43 def print(string) @screen.owin.addstr(string) refresh end
puts(string)
click to toggle source
# File lib/toucan_cli/application.rb, line 38 def puts(string) @screen.owin.addstr("#{string}\n") refresh end
Private Instance Methods
refresh()
click to toggle source
# File lib/toucan_cli/application.rb, line 50 def refresh @screen.owin.refresh @screen.iwin.refresh end