Class | Net::SSH::Multi::ServerList |
In: |
lib/net/ssh/multi/server_list.rb
|
Parent: | Object |
Encapsulates a list of server objects, both dynamic (Net::SSH::Multi::DynamicServer) and static (Net::SSH::Multi::Server). It attempts to make it transparent whether a dynamic server set has been evaluated or not. Note that a ServerList is NOT an Array, though it is Enumerable.
Create a new ServerList that wraps the given server list. Duplicate entries will be discarded.
Adds the given server to the list, and returns the argument. If an identical server definition already exists in the collection, the argument is not added, and the existing server record is returned instead.
Iterates over each distinct server record in the collection. This will correctly iterate over server records instantiated by a DynamicServer as well, but only if the dynamic server has been "evaluated" (see Net::SSH::Multi::DynamicServer#evaluate!).
Returns an array of all servers in the list, with dynamic server records expanded. The result is an array of distinct server records (duplicates are removed from the result).
Works exactly as Enumerable#select, but returns the result as a new ServerList instance.