class EventMachine::Synchrony::KeyboardHandler
Public Class Methods
new(keyboard)
click to toggle source
# File lib/em-synchrony/keyboard.rb, line 17 def initialize(keyboard) @keyboard = keyboard end
Public Instance Methods
receive_line(line)
click to toggle source
# File lib/em-synchrony/keyboard.rb, line 21 def receive_line(line) # Simulate gets by adding a trailing line feed @input = "#{line}#{$/}" close_connection end
unbind()
click to toggle source
# File lib/em-synchrony/keyboard.rb, line 28 def unbind @keyboard.current_fiber.resume @input end