Class: Capistrano::ASG::Rolling::AutoscaleGroups

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/capistrano/asg/rolling/autoscale_groups.rb

Overview

Collection of Auto Scaling Groups.

Instance Method Summary collapse

Constructor Details

#initialize(groups = []) ⇒ AutoscaleGroups

Returns a new instance of AutoscaleGroups.



10
11
12
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 10

def initialize(groups = [])
  @groups = groups
end

Instance Method Details

#<<(group) ⇒ Object



14
15
16
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 14

def <<(group)
  @groups << group
end

#each(&block) ⇒ Object



18
19
20
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 18

def each(&block)
  @groups.reject { |group| filtered?(group) }.each(&block)
end

#launch_templatesObject



22
23
24
25
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 22

def launch_templates
  templates = @groups.map(&:launch_template)
  LaunchTemplates.new(templates)
end

#with_launch_template(launch_template) ⇒ Object



27
28
29
# File 'lib/capistrano/asg/rolling/autoscale_groups.rb', line 27

def with_launch_template(launch_template)
  self.class.new(select { |group| group.launch_template == launch_template })
end