Class: Linda::SocketIO::Client::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/linda-socket.io-client/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url_or_io) ⇒ Client

Returns a new instance of Client.



16
17
18
19
20
21
22
# File 'lib/linda-socket.io-client/client.rb', line 16

def initialize(url_or_io)
  if url_or_io.kind_of? String
    @io = ::SocketIO::Client::Simple.connect url_or_io
  elsif url_or_io.kind_of? ::SocketIO::Client::Simple::Client
    @io = url_or_io
  end
end

Instance Attribute Details

#ioObject (readonly)

Returns the value of attribute io.



14
15
16
# File 'lib/linda-socket.io-client/client.rb', line 14

def io
  @io
end

Instance Method Details

#tuplespace(name) ⇒ Object



24
25
26
# File 'lib/linda-socket.io-client/client.rb', line 24

def tuplespace(name)
  TupleSpace.new(self, name.to_s)
end

#urlObject



28
29
30
# File 'lib/linda-socket.io-client/client.rb', line 28

def url
  @io.url
end