Class: ConfCtl::Swpins::ClusterNameList

Inherits:
Array
  • Object
show all
Defined in:
lib/confctl/swpins/cluster_name_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(channels: nil, pattern: '*', machines: nil) ⇒ ClusterNameList

Returns a new instance of ClusterNameList.

Parameters:



6
7
8
9
10
11
12
13
# File 'lib/confctl/swpins/cluster_name_list.rb', line 6

def initialize(channels: nil, pattern: '*', machines: nil)
  super()
  channels ||= ConfCtl::Swpins::ChannelList.get

  (machines || MachineList.new).each_value do |machine|
    self << Swpins::ClusterName.new(machine, channels) if Pattern.match?(pattern, machine.name)
  end
end