Class: Farcall::LocalConnection::Connection

Inherits:
Transport
  • Object
show all
Defined in:
lib/farcall/transport.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from Transport

#on_abort, #on_close, #on_data_received

Instance Method Summary collapse

Methods inherited from Transport

#close, #closed?, create, #receive_data

Constructor Details

#initialize(other_loop = nil) ⇒ Connection

Returns a new instance of Connection.



101
102
103
104
105
106
# File 'lib/farcall/transport.rb', line 101

def initialize other_loop = nil
  if other_loop
    other_loop.other = self
    @other           = other_loop
  end
end

Instance Attribute Details

#otherObject

Returns the value of attribute other.



99
100
101
# File 'lib/farcall/transport.rb', line 99

def other
  @other
end

Instance Method Details

#send_data(hash) ⇒ Object



108
109
110
# File 'lib/farcall/transport.rb', line 108

def send_data hash
  @other.on_data_received.call hash
end