Class: KeyboardHandler
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- KeyboardHandler
- Defined in:
- lib/active_resource/keyboard_handler.rb
Instance Attribute Summary collapse
-
#ws ⇒ Object
Returns the value of attribute ws.
Instance Method Summary collapse
-
#initialize(ws) ⇒ KeyboardHandler
constructor
A new instance of KeyboardHandler.
- #receive_data(keystrokes) ⇒ Object
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
#ws ⇒ Object
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 |