Class: Autoscale::Agent::WorkerServers

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/autoscale/agent/worker_servers.rb

Instance Method Summary collapse

Constructor Details

#initializeWorkerServers

Returns a new instance of WorkerServers.



6
7
8
# File 'lib/autoscale/agent/worker_servers.rb', line 6

def initialize
  @servers = []
end

Instance Method Details

#<<(server) ⇒ Object



14
15
16
# File 'lib/autoscale/agent/worker_servers.rb', line 14

def <<(server)
  @servers << server
end

#each(&block) ⇒ Object



10
11
12
# File 'lib/autoscale/agent/worker_servers.rb', line 10

def each(&block)
  @servers.each(&block)
end

#find(tokens) ⇒ Object



18
19
20
# File 'lib/autoscale/agent/worker_servers.rb', line 18

def find(tokens)
  @servers.find { |server| tokens.include?(server.token) }
end