Class: Cottus::Client
- Inherits:
-
Object
- Object
- Cottus::Client
- Extended by:
- Forward
- Defined in:
- lib/cottus/client.rb
Instance Attribute Summary collapse
-
#connections ⇒ Object
readonly
Returns the value of attribute connections.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Instance Method Summary collapse
- #hosts ⇒ Object
-
#initialize(hosts, options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from 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, ={}) @connections = create_connections(hosts) @strategy = create_strategy() end |
Instance Attribute Details
#connections ⇒ Object (readonly)
Returns the value of attribute connections.
9 10 11 |
# File 'lib/cottus/client.rb', line 9 def connections @connections end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
9 10 11 |
# File 'lib/cottus/client.rb', line 9 def strategy @strategy end |
Instance Method Details
#hosts ⇒ Object
16 17 18 |
# File 'lib/cottus/client.rb', line 16 def hosts @connections.map(&:host) end |