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.

Methods

add   concat   each   flatten   new   select   to_ary  

Included Modules

Enumerable

Public Class methods

Create a new ServerList that wraps the given server list. Duplicate entries will be discarded.

Public Instance methods

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.

Adds an array (or otherwise Enumerable list) of servers to this list, by calling add for each argument. Returns self.

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.

to_ary()

Alias for flatten

[Validate]