Class: Hokaido::Broadcast::InputHandler

Inherits:
Object
  • Object
show all
Includes:
Celluloid
Defined in:
lib/hokaido/broadcast.rb

Instance Method Summary collapse

Constructor Details

#initialize(ptyin) ⇒ InputHandler

Returns a new instance of InputHandler.



47
48
49
50
51
# File 'lib/hokaido/broadcast.rb', line 47

def initialize(ptyin)
  @ptyin = ptyin

  async.run
end

Instance Method Details

#runObject



53
54
55
56
57
58
59
# File 'lib/hokaido/broadcast.rb', line 53

def run
  while char = $stdin.getch
    @ptyin.putc char
  end

  terminate
end