Class: Autoscale::Agent::WorkerServers
- Inherits:
-
Object
- Object
- Autoscale::Agent::WorkerServers
- Includes:
- Enumerable
- Defined in:
- lib/autoscale/agent/worker_servers.rb
Instance Method Summary collapse
- #<<(server) ⇒ Object
- #each(&block) ⇒ Object
- #find(tokens) ⇒ Object
-
#initialize ⇒ WorkerServers
constructor
A new instance of WorkerServers.
Constructor Details
#initialize ⇒ WorkerServers
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 |