Class: Floom::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/floom/client.rb

Direct Known Subclasses

Master, Reporter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



6
7
8
9
10
# File 'lib/floom/client.rb', line 6

def initialize(options = {})
  @host = options[:host]
  @port = options[:port]
  establish_connection!
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



4
5
6
# File 'lib/floom/client.rb', line 4

def connection
  @connection
end

Instance Method Details

#reset_connection!Object



16
17
18
19
# File 'lib/floom/client.rb', line 16

def reset_connection!
  @socket = @transport = @protocol = @connection = nil
  establish_connection!
end

#to_sObject



12
13
14
# File 'lib/floom/client.rb', line 12

def to_s
  "#<#{self.class}:#{object_id} host:#{@host} port:#{@port}>"
end