Class: ProxyLocal::ClientProxy
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- ProxyLocal::ClientProxy
- Defined in:
- lib/proxylocal/client_proxy.rb
Instance Method Summary collapse
- #on_data(&block) ⇒ Object
- #on_unbind(&block) ⇒ Object
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Instance Method Details
#on_data(&block) ⇒ Object
17 18 19 |
# File 'lib/proxylocal/client_proxy.rb', line 17 def on_data(&block) @callbacks[:on_data] = block end |
#on_unbind(&block) ⇒ Object
21 22 23 |
# File 'lib/proxylocal/client_proxy.rb', line 21 def on_unbind(&block) @callbacks[:on_unbind] = block end |
#post_init ⇒ Object
5 6 7 |
# File 'lib/proxylocal/client_proxy.rb', line 5 def post_init @callbacks = {} end |
#receive_data(data) ⇒ Object
9 10 11 |
# File 'lib/proxylocal/client_proxy.rb', line 9 def receive_data(data) @callbacks[:on_data].call(data) if @callbacks.has_key?(:on_data) end |
#unbind ⇒ Object
13 14 15 |
# File 'lib/proxylocal/client_proxy.rb', line 13 def unbind @callbacks[:on_unbind].call if @callbacks.has_key?(:on_unbind) end |