Sha256: 699eeb91d0f480ad1c1e7a567912be1dc91a7237d8c1b1c303a7d1698e4e9c38
Contents?: true
Size: 487 Bytes
Versions: 2
Compression:
Stored size: 487 Bytes
Contents
require 'eventmachine' module ProxyLocal class ClientProxy < EventMachine::Connection def post_init @callbacks = {} end def receive_data(data) @callbacks[:on_data].call(data) if @callbacks.has_key?(:on_data) end def unbind @callbacks[:on_unbind].call if @callbacks.has_key?(:on_unbind) end def on_data(&block) @callbacks[:on_data] = block end def on_unbind(&block) @callbacks[:on_unbind] = block end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
proxylocal-0.3.1 | lib/proxylocal/client_proxy.rb |
proxylocal-0.3.0 | lib/proxylocal/client_proxy.rb |