Class: Offshore::Suite
- Inherits:
-
Object
- Object
- Offshore::Suite
- Defined in:
- lib/offshore/client/suite.rb
Instance Method Summary collapse
- #all_hosts!(method, *args) ⇒ Object
- #default ⇒ Object
- #hosts ⇒ Object
- #start(server_array_or_hash) ⇒ Object
- #stop ⇒ Object
Instance Method Details
#all_hosts!(method, *args) ⇒ Object
11 12 13 14 15 |
# File 'lib/offshore/client/suite.rb', line 11 def all_hosts!(method, *args) hosts.each do |host| host.send(method, *args) end end |
#default ⇒ Object
7 8 9 |
# File 'lib/offshore/client/suite.rb', line 7 def default hosts.first end |
#hosts ⇒ Object
3 4 5 |
# File 'lib/offshore/client/suite.rb', line 3 def hosts @hosts ||= [] end |
#start(server_array_or_hash) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/offshore/client/suite.rb', line 17 def start(server_array_or_hash) server_array = server_array_or_hash.is_a?(Array) ? server_array_or_hash : [server_array_or_hash] raise "Need one server" if server_array.size != 1 server_array.each do |hash| hosts << Host.new(hash) end all_hosts!(:suite_start) end |