Class: KeyboardHandler

Inherits:
EventMachine::Connection
  • Object
show all
Defined in:
lib/active_resource/keyboard_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ws) ⇒ KeyboardHandler

Returns a new instance of KeyboardHandler.



4
5
6
# File 'lib/active_resource/keyboard_handler.rb', line 4

def initialize(ws)
  @ws = ws
end

Instance Attribute Details

#wsObject

Returns the value of attribute ws.



2
3
4
# File 'lib/active_resource/keyboard_handler.rb', line 2

def ws
  @ws
end

Instance Method Details

#receive_data(keystrokes) ⇒ Object



8
9
10
# File 'lib/active_resource/keyboard_handler.rb', line 8

def receive_data keystrokes
  @ws.send(Base64.encode64(keystrokes))
end