Class: EventMachine::Connection
- Inherits:
-
Object
- Object
- EventMachine::Connection
- Defined in:
- lib/em-serialport/connection.rb
Instance Method Summary collapse
- #associate_callback_target(sig) ⇒ Object
- #on_data(&blk) ⇒ Object
- #receive_data(data) ⇒ Object
- #trigger_on_data(data) ⇒ Object
Instance Method Details
#associate_callback_target(sig) ⇒ Object
13 14 15 |
# File 'lib/em-serialport/connection.rb', line 13 def associate_callback_target(sig) return(nil) end |
#on_data(&blk) ⇒ Object
3 |
# File 'lib/em-serialport/connection.rb', line 3 def on_data(&blk); @on_data = blk; end |
#receive_data(data) ⇒ Object
9 10 11 |
# File 'lib/em-serialport/connection.rb', line 9 def receive_data data trigger_on_data(data) end |
#trigger_on_data(data) ⇒ Object
5 6 7 |
# File 'lib/em-serialport/connection.rb', line 5 def trigger_on_data(data) @on_data.call(data) if @on_data end |