Class: Cottus::Client

Inherits:
Object
  • Object
show all
Extended by:
Forward
Defined in:
lib/cottus/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Forward

forward

Constructor Details

#initialize(hosts, options = {}) ⇒ Client

Returns a new instance of Client.



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

def initialize(hosts, options={})
  @connections = create_connections(hosts)
  @strategy = create_strategy(options)
end

Instance Attribute Details

#connectionsObject (readonly)

Returns the value of attribute connections.



9
10
11
# File 'lib/cottus/client.rb', line 9

def connections
  @connections
end

#strategyObject (readonly)

Returns the value of attribute strategy.



9
10
11
# File 'lib/cottus/client.rb', line 9

def strategy
  @strategy
end

Instance Method Details

#hostsObject



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

def hosts
  @connections.map(&:host)
end